Tests: Import URLs surrounded by single quotes

This updates the regex for CSS URLs in the WPT import script to
correctly match URLs surrounded by single quotes.
This commit is contained in:
Glenn Skrzypczak 2025-03-14 14:31:16 +01:00
parent bf517f9ac2
commit 641a23c5c1

View file

@ -52,7 +52,7 @@ class LinkedResourceFinder(HTMLParser):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self._tag_stack_ = [] self._tag_stack_ = []
self._match_css_url_ = re.compile(r"url\(\"?(?P<url>[^\")]+)\"?\)") self._match_css_url_ = re.compile(r"url\(['\"]?(?P<url>[^'\")]+)['\"]?\)")
self._match_css_import_string_ = re.compile(r"@import\s+\"(?P<url>[^\")]+)\"") self._match_css_import_string_ = re.compile(r"@import\s+\"(?P<url>[^\")]+)\"")
self._resources = [] self._resources = []