dj_angles.regex_replacer ======================== .. py:module:: dj_angles.regex_replacer Module Contents --------------- .. py:function:: get_replacements(html: str, *, raise_for_missing_start_tag: bool = True) -> list[tuple[str, str]] Get a list of replacements (tuples that consists of 2 strings) based on the template HTML. :param param html: Template HTML. :param param raise_for_missing_start_tag: Whether or not to raise an error if an invalid tag is discovered. :returns: A list of tuples where the first item in the tuple is the existing tag element, e.g. "" and the second item is the replacement string, e.g. "{% csrf_token %}". .. py:function:: replace_django_template_tags(html: str) -> str Gets a list of replacements based on template HTML, replaces the necessary strings, and returns the new string. :param param html: Template HTML. :returns: The converted template HTML.