dj_angles.regex_replacer.tag_replacer

Module Contents

dj_angles.regex_replacer.tag_replacer.logger
dj_angles.regex_replacer.tag_replacer.get_tag_replacements(html: str, *, raise_for_missing_start_tag: bool = True) list[dj_angles.regex_replacer.objects.Replacement]

Get a list of tag replacements based on the template HTML.

Parameters:
  • html (param) – Template HTML.

  • raise_for_missing_start_tag (param) – 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. “<dj-csrf />” and the second item is the replacement string, e.g. “{% csrf_token %}”.