diff --git a/src/djlint/helpers.py b/src/djlint/helpers.py index 5cb7921..4ac11c2 100644 --- a/src/djlint/helpers.py +++ b/src/djlint/helpers.py @@ -12,7 +12,11 @@ def is_ignored_block_opening(config: Config, item: str) -> bool: """ last_index = 0 inline = list( - re.finditer(config.ignored_blocks, item, flags=re.IGNORECASE | re.VERBOSE) + re.finditer( + config.ignored_blocks, + item, + flags=re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL, + ) ) if inline: @@ -64,7 +68,7 @@ def is_safe_closing_tag(config: Config, item: str) -> bool: re.finditer( re.compile( config.ignored_inline_blocks + r" | " + config.ignored_blocks, - flags=re.IGNORECASE | re.VERBOSE, + flags=re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL, ), item, ) @@ -88,7 +92,8 @@ def inside_ignored_block(config: Config, html: str, match: re.Match) -> bool: for ignored_match in list( re.finditer( re.compile( - config.ignored_blocks, re.DOTALL | re.IGNORECASE | re.VERBOSE + config.ignored_blocks, + re.DOTALL | re.IGNORECASE | re.VERBOSE | re.MULTILINE | re.DOTALL, ), html, ) diff --git a/src/djlint/reformat.py b/src/djlint/reformat.py index 44d8d3f..3dcab56 100644 --- a/src/djlint/reformat.py +++ b/src/djlint/reformat.py @@ -18,8 +18,11 @@ def reformat_file(config: Config, this_file: Path) -> dict: rawcode = this_file.read_text(encoding="utf8") compressed = compress_html(rawcode, config) + expanded = expand_html(compressed, config) + condensed = condense_html(expanded, config) + indented = indent_html(condensed, config) beautified_code = indented diff --git a/src/djlint/settings.py b/src/djlint/settings.py index 328c5ed..2ca99a0 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -341,7 +341,8 @@ class Config: | <\?php |