mirror of https://github.com/yt-dlp/yt-dlp.git
[parsing] support uppercase SCRIPT tags as suggested by github-advanced-security bot
This commit is contained in:
parent
b35550248a
commit
c34166d7c8
|
@ -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>
|
||||||
--------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^---------
|
--------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^---------
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue