[parsing] support uppercase SCRIPT tags as suggested by github-advanced-security bot

This commit is contained in:
flashdagger
2023-11-13 06:54:28 +01:00
parent b35550248a
commit c34166d7c8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ class TestParsing(unittest.TestCase):
^^^^^^^^^^^^^^^^^^^^^^^^^^^------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
here is <!-- a comment --> and <!-- another comment --> end here is <!-- a comment --> and <!-- another comment --> end
----------------^^^^^^^^^^^----------------^^^^^^^^^^^^^^^^^--------- ----------------^^^^^^^^^^^----------------^^^^^^^^^^^^^^^^^---------
<script> ignore here </script> <script> and here </script> <script> ignore here </script> <SCRIPT> and here </SCRIPT>
--------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^--------- --------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^---------
''' '''
+1 -1
View File
@@ -20,7 +20,7 @@ class HTMLIgnoreRanges:
if offset in ranges: if offset in ranges:
... ...
""" """
REGEX = re.compile(r'<!--|-->|</?\s*(?:script|style)\b[^>]*>') REGEX = re.compile(r'<!--|-->|</?\s*(?:script|style)\b[^>]*>', flags=re.IGNORECASE)
def __init__(self, html): def __init__(self, html):
self.html = html self.html = html