mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-02 05:30:24 +00:00
fix(curly hash comment): fix formatting on curly hash comment blocks
closes #265
This commit is contained in:
parent
1526e87bf9
commit
4dc2140c41
3 changed files with 9 additions and 3 deletions
|
|
@ -8,6 +8,12 @@
|
|||
<h4 align="center">The missing formatter and linter for HTML templates.</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://twitter.com/intent/tweet?text=djLint%20%7C%20The%20missing%20formatter%20and%20linter%20for%20HTML%20templates.&url=https://djlint.com/&hashtags=djlint,html-templates,django,jinja,developers"><img alt="tweet" src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" /></a>
|
||||
<a href="https://discord.gg/taghAqebzU">
|
||||
<img src="https://badgen.net/discord/online-members/taghAqebzU?icon=discord&label" alt="Discord Chat">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://codecov.io/gh/Riverside-Healthcare/djlint">
|
||||
<img src="https://codecov.io/gh/Riverside-Healthcare/djlint/branch/master/graph/badge.svg?token=eNTG721BAA" alt="Codecov Status">
|
||||
</a>
|
||||
|
|
@ -20,9 +26,6 @@
|
|||
<a href="https://pepy.tech/project/djlint">
|
||||
<img src="https://pepy.tech/badge/djlint" alt="Downloads">
|
||||
</a>
|
||||
<a href="https://discord.gg/taghAqebzU">
|
||||
<img src="https://img.shields.io/badge/chat-discord-green" alt="Discord Chat">
|
||||
</a>
|
||||
<a href="https://pypi.org/project/djlint/">
|
||||
<img src="https://img.shields.io/pypi/v/djlint" alt="Pypi Download">
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ def indent_html(rawcode: str, config: Config) -> str:
|
|||
ignored_level = 0
|
||||
|
||||
for item in rawcode_flat_list:
|
||||
|
||||
# if a raw tag first line
|
||||
if not is_block_raw and is_ignored_block_opening(config, item):
|
||||
is_raw_first_line = True
|
||||
|
|
|
|||
|
|
@ -560,6 +560,8 @@ class Config:
|
|||
# django/jinja/nunjucks
|
||||
| {\#\s*djlint\:\s*off\s*\#}.*?(?={\#\s*djlint\:\s*on\s*\#})
|
||||
| {%\s*comment\s*%\}\s*djlint\:off\s*\{%\s*endcomment\s*%\}.*?(?={%\s*comment\s*%\}\s*djlint\:on\s*\{%\s*endcomment\s*%\})
|
||||
# inline jinja comments
|
||||
| {\#(?!\s*djlint\:\s*(?:off|on)).*?\#}
|
||||
# handlebars
|
||||
| {{!--\s*djlint\:off\s*--}}.*?(?={{!--\s*djlint\:on\s*--}})
|
||||
# golang
|
||||
|
|
|
|||
Loading…
Reference in a new issue