mirror of
https://github.com/Hopiu/djLint.git
synced 2026-03-16 21:40:24 +00:00
parent
66a294bddb
commit
e4fe62f52e
2 changed files with 6 additions and 1 deletions
|
|
@ -184,7 +184,7 @@
|
|||
message: Tag seems to be an orphan.
|
||||
flags: re.I|re.DOTALL
|
||||
patterns:
|
||||
- <((/?(\w+))\b(\"[^\"]*\"|'[^']*'|{{[^}]*}}|{%[^%]*%}|[^'\">{}])*)(?<!/)>
|
||||
- <((/?(\w+))\b(\"[^\"]*\"|'[^']*'|{{[^}]*}}|{%[^%]*%}|{#[^%]*#}|[^'\">{}])*)(?<!/)>
|
||||
- rule:
|
||||
name: H026
|
||||
message: Empty id and class tags can be removed.
|
||||
|
|
|
|||
|
|
@ -522,6 +522,11 @@ def test_H025(runner: CliRunner, tmp_file: TextIO) -> None:
|
|||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert "H025" not in result.output
|
||||
|
||||
# test {# #} inside tag
|
||||
write_to_file(tmp_file.name, b'<div id="example" {# for #}></div>')
|
||||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert "H025" not in result.output
|
||||
|
||||
|
||||
def test_H026(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
write_to_file(tmp_file.name, b'<asdf id="" >')
|
||||
|
|
|
|||
Loading…
Reference in a new issue