mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-09-01 08:41:50 +03:00
[parsing] support uppercase SCRIPT tags as suggested by github-advanced-security bot
This commit is contained in:
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user