This commit is contained in:
Christopher Pickering 2021-10-07 15:42:02 +02:00
parent 479326873a
commit 4d5f7819ce
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
3 changed files with 6 additions and 2 deletions

View file

@ -69,7 +69,7 @@ def lint_file(config: Config, this_file: Path) -> Dict:
),
html,
):
print(match.group(1).split(" ")[0])
if match.group(1) and not re.match(
re.compile(
fr"^/?{config.always_self_closing_html_tags}", re.I | re.X

View file

@ -303,4 +303,4 @@
name: H025
message: Tag seems to be an orphan.
patterns:
- <(/?(?:\w+)(?:\s((?:{%[^(?:%}]*?%})|(?:{{[^(?:}})]*?}})|[^<>/])*)?)>
- <(/?(?:\w+)(?:\s(?:(?:{%[^(?:%}]*?%})|(?:{{[^(?:}})]*?}})|[^<>])*[^/])?)>

View file

@ -355,6 +355,10 @@ def test_H025(runner: CliRunner, tmp_file: TextIO) -> None:
result = runner.invoke(djlint, [tmp_file.name])
assert "H025" not in result.output
write_to_file(tmp_file.name, b"<alpha />")
result = runner.invoke(djlint, [tmp_file.name])
assert "H025" not in result.output
write_to_file(
tmp_file.name,
b'<script src="{% static \'notifications/notify.js\' %}" type="text/javascript"></script>',