mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-05 12:24:43 +00:00
fixed #83
This commit is contained in:
parent
479326873a
commit
4d5f7819ce
3 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -303,4 +303,4 @@
|
|||
name: H025
|
||||
message: Tag seems to be an orphan.
|
||||
patterns:
|
||||
- <(/?(?:\w+)(?:\s((?:{%[^(?:%}]*?%})|(?:{{[^(?:}})]*?}})|[^<>/])*)?)>
|
||||
- <(/?(?:\w+)(?:\s(?:(?:{%[^(?:%}]*?%})|(?:{{[^(?:}})]*?}})|[^<>])*[^/])?)>
|
||||
|
|
|
|||
|
|
@ -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>',
|
||||
|
|
|
|||
Loading…
Reference in a new issue