This commit is contained in:
Christopher Pickering 2021-09-30 10:25:34 +02:00
parent c3b21323ea
commit 310e85ba33
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
3 changed files with 11 additions and 4 deletions

View file

@ -12,7 +12,7 @@
project = "djlint"
copyright = "2021, Riverside Healthcare"
author = "Christopher Pickering"
release = "0.4.5"
release = "0.4.6"
version = release
# -- General configuration ---------------------------------------------------

View file

@ -1,6 +1,10 @@
Changelog
=========
0.4.6
-----
- fix bug `#31 <https://github.com/Riverside-Healthcare/djLint/issues/31>`_
0.4.5
-----
- Added best practices to docs

View file

@ -120,16 +120,19 @@ def compress_html(html: str, config: Config) -> str:
r"\1\3\4",
html,
)
print(html)
print(
fr"(<({config.single_line_html_tags})[ ][^>\n]{{,80}}>)\s*([^<\n]{{,80}})\s*?(</(\2)>)"
)
html = re.sub(
re.compile(
fr"(<({config.single_line_html_tags})[ ][^\n]{{,80}}>)\s*([^<\n]{{,80}})\s*?(</(\2)>)",
fr"(<({config.single_line_html_tags})[ ][^>\n]{{,80}}>)\s*([^<\n]{{,80}})\s*?(</(\2)>)",
re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE,
),
r"\1\3\4",
html,
)
print(html)
html = re.sub(
re.compile(
rf"({{%-?[ ]*?({config.single_line_template_tags})[^\n]{{,30}}%}})\s*([^%\n]{{,50}})\s*?({{%-?[ ]+?end(\2)[ ]*?%}})",