mirror of
https://github.com/Hopiu/djLint.git
synced 2026-03-17 05:50:24 +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.
|
||||
flags: re.DOTALL|re.I
|
||||
patterns:
|
||||
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
||||
- <form\s+?[^>]*?(?: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:|tel:)[\w|/]+
|
||||
- rule:
|
||||
name: J018
|
||||
message: (Jinja) Internal links should use the {{ url_for() ... }} pattern.
|
||||
flags: re.DOTALL|re.I
|
||||
patterns:
|
||||
- <(?:a|div|span|input)\b[^>]*?\s(?:href|data-url|data-src|action)=[\"|'](?!(?:https?://)|javascript:|on\w+:|mailto:)[\w|/]+
|
||||
- <form\s+?[^>]*?(?: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:|tel:)[\w|/]+
|
||||
- rule:
|
||||
name: H019
|
||||
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:
|
||||
write_to_file(
|
||||
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])
|
||||
assert result.exit_code == 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue