mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-05 04:14:51 +00:00
parent
919d03457d
commit
f08e3acee3
2 changed files with 5 additions and 5 deletions
|
|
@ -134,15 +134,15 @@
|
||||||
message: (Django) Internal links should use the {% url ... %} pattern.
|
message: (Django) Internal links should use the {% url ... %} pattern.
|
||||||
flags: re.DOTALL|re.I
|
flags: re.DOTALL|re.I
|
||||||
patterns:
|
patterns:
|
||||||
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:|tel:)[\w|/]+
|
||||||
- <form\s+?[^>]*?(?:action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
- <form\s+?[^>]*?(?:action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:|tel:)[\w|/]+
|
||||||
- rule:
|
- rule:
|
||||||
name: J018
|
name: J018
|
||||||
message: (Jinja) Internal links should use the {{ url_for() ... }} pattern.
|
message: (Jinja) Internal links should use the {{ url_for() ... }} pattern.
|
||||||
flags: re.DOTALL|re.I
|
flags: re.DOTALL|re.I
|
||||||
patterns:
|
patterns:
|
||||||
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:|tel:)[\w|/]+
|
||||||
- <form\s+?[^>]*?(?:action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
- <form\s+?[^>]*?(?:action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:|tel:)[\w|/]+
|
||||||
- rule:
|
- rule:
|
||||||
name: H019
|
name: H019
|
||||||
message: Replace 'javascript:abc()' with on_ event and real url.
|
message: Replace 'javascript:abc()' with on_ event and real url.
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ def test_DJ018(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||||
# test mailto:
|
# test mailto:
|
||||||
write_to_file(
|
write_to_file(
|
||||||
tmp_file.name,
|
tmp_file.name,
|
||||||
b'<a href="mailto:joe"></a>',
|
b'<a href="mailto:joe"></a><a href="tel:joe"></a>',
|
||||||
)
|
)
|
||||||
result = runner.invoke(djlint, [tmp_file.name])
|
result = runner.invoke(djlint, [tmp_file.name])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue