mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-26 05:23:42 +00:00
fixed #110, added test
This commit is contained in:
parent
e0fed97e70
commit
84a182595c
3 changed files with 6 additions and 2 deletions
|
|
@ -69,7 +69,6 @@ def lint_file(config: Config, this_file: Path) -> Dict:
|
|||
),
|
||||
html,
|
||||
):
|
||||
|
||||
if match.group(1) and not re.match(
|
||||
re.compile(
|
||||
fr"^/?{config.always_self_closing_html_tags}", re.I | re.X
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@
|
|||
message: Tag seems to be an orphan.
|
||||
flags: re.I|re.DOTALL
|
||||
patterns:
|
||||
- <(/?(?:\w+)(?:\s?(?:(?:{%[^(?:%}]*?%})|(?:{{[^(?:}})]*?}})|[^<>])*[^/])?)>
|
||||
- <(/?(?:\w+)\b(\"[^\"]*\"|'[^']*'|{[^}]*}|[^'\">{}/])*)>
|
||||
- rule:
|
||||
name: H026
|
||||
message: Emtpy id and class tags can be removed.
|
||||
|
|
|
|||
|
|
@ -397,6 +397,11 @@ def test_H025(runner: CliRunner, tmp_file: TextIO) -> None:
|
|||
assert "H025 1:" in result.output
|
||||
assert "H025 2:" not in result.output
|
||||
|
||||
# test tags inside attibutes
|
||||
write_to_file(tmp_file.name, b'<span title="<p>Bar</p>">Foo</span>')
|
||||
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