mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-24 23:14:45 +00:00
fixed #112, added tests
This commit is contained in:
parent
ca87bb7d22
commit
e0fed97e70
2 changed files with 8 additions and 8 deletions
|
|
@ -88,7 +88,7 @@
|
|||
flags: re.DOTALL|re.I|re.M|re.X
|
||||
patterns:
|
||||
- |
|
||||
<(?:(?!meta)\w+)\s+?[^>]*?(?:class|id|src|width|height|alt|style|lang|title|href|action|method|checked|required|srcset)=[a-zA-Z_-]+
|
||||
<(?:(?!meta)\w+)\b(\"[^\"]*\"|'[^']*'|{[^}]*}|[^'\">{}])*(?:class|id|src|width|height|alt|style|lang|title|href|action|method|checked|required|srcset)=[a-zA-Z_-]+
|
||||
- <(?:meta)\s+?[^>]*?(?:class|id|src|alt|style|lang|title|href|action|method|name)=[a-zA-Z_-]+
|
||||
- rule:
|
||||
name: H012
|
||||
|
|
|
|||
|
|
@ -133,13 +133,13 @@ def test_H011(runner: CliRunner, tmp_file: TextIO) -> None:
|
|||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert "H011 1:" not in result.output
|
||||
|
||||
# # check keywords inside template syntax
|
||||
# write_to_file(
|
||||
# tmp_file.name,
|
||||
# b'<a href="{{ url_for(\'connection_bp.one_connection\', connection_id=connection.id) }}">{{ connection }}</a>',
|
||||
# )
|
||||
# result = runner.invoke(djlint, [tmp_file.name])
|
||||
# assert "H011 1:" not in result.output
|
||||
# check keywords inside template syntax
|
||||
write_to_file(
|
||||
tmp_file.name,
|
||||
b"<a href=\"{{ url_for('connection_bp.one_connection', connection_id=connection.id) }}\">{{ connection }}</a>",
|
||||
)
|
||||
result = runner.invoke(djlint, [tmp_file.name])
|
||||
assert "H011 1:" not in result.output
|
||||
|
||||
|
||||
def test_H012(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue