removed template tag from ignored blocks

This commit is contained in:
Christopher Pickering 2021-08-03 10:21:52 -05:00
parent 907fd9ad87
commit 2c93e1d5f1
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
2 changed files with 3 additions and 6 deletions

View file

@ -94,15 +94,12 @@ def indent_html(rawcode):
elif (
re.search(r"^(?:" + tag_unindent + r")", item, re.IGNORECASE | re.MULTILINE)
and is_block_raw is False
or re.search(ignored_tag_closing, item, re.IGNORECASE)
):
indent_level = max(indent_level - 1, 0)
tmp = (indent * indent_level) + item + "\n"
blank_counter = 0
elif re.search(ignored_tag_closing, item, re.IGNORECASE):
tmp = (indent * indent_level) + item + "\n"
blank_counter = 0
elif (
re.search(r"^" + tag_unindent_line, item, re.IGNORECASE | re.MULTILINE)
and is_block_raw is False

View file

@ -9,10 +9,10 @@ break_html_tags = ["a", "abbr"]
# indicates tags whose contents should not be formatted
ignored_tag_opening = r"<script|<style|<!--|{\*|<\?php|<pre|{#"
ignored_tag_opening = r"<script|<style|<!--|{\*|<\?php|<pre"
# indicates when to stop ignoring
ignored_tag_closing = r"</script|</style|-->|\*}|\?>|</pre|#}"
ignored_tag_closing = r"</script|</style|-->|\*}|\?>|</pre"
# the contents of these tag blocks will be indented
tag_indent = r"(?:\{\{\#)|\{% +?(if|for|block|else|spaceless|compress|addto|language|with)|(?:{% verbatim %})|(?:<(?:html|head|body|div|a|nav|ul|ol|dl|li|table|thead|tbody|tr|th|td|blockquote|textarea|select|form|option|cache|optgroup|fieldset|legend|label|header|main|section|aside|footer|figure|video|span|p|g|svg|h\d|button|img|path|script|style|source))"