added rule H020. closes #64

This commit is contained in:
Christopher Pickering 2021-10-06 08:43:06 +02:00
parent a657424ed6
commit b7e456a947
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
3 changed files with 12 additions and 0 deletions

View file

@ -1,6 +1,10 @@
Changelog
=========
Next Release
------------
- Added rule H020 to find empty tag pairs
0.5.3
-----
- Change stdout for ``--reformat/check`` options to only print new html when using stdin as the input

View file

@ -49,6 +49,8 @@ Codes
+--------+-------------------------------------------------------------------------+
| H019 | Replace 'javascript:abc()' with on_ event and real url. |
+--------+-------------------------------------------------------------------------+
| H020 | Empty tag pair found. Consider removing. |
+--------+-------------------------------------------------------------------------+
Adding Rules
------------

View file

@ -269,3 +269,9 @@
patterns:
- <(?:a|div|span|input)\s+?[^>]*?(?:href|data-url)=[\"|']javascript:[\w|/]+
- <form\s+?[^>]*?(?:action)=[\"|']javascript:[\w|/]+
- rule:
name: H020
message: Empty tag pair found. Consider removing.
flags: re.DOTALL|re.I
patterns:
- <(\w+)\s*?>\s*?<\/\1>