mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-04 03:44:43 +00:00
removed template tag from ignored blocks
This commit is contained in:
parent
907fd9ad87
commit
2c93e1d5f1
2 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))"
|
||||
|
|
|
|||
Loading…
Reference in a new issue