|
|
|
@ -245,7 +245,7 @@ class MatchingElementParser(HTMLTagParser):
|
|
|
|
|
value_regex = re.escape(value_regex)
|
|
|
|
|
|
|
|
|
|
return rf'''(?x)
|
|
|
|
|
<(?:{tag})
|
|
|
|
|
<(?i:{tag})
|
|
|
|
|
(?:\s(?:[^>"'\\]|"[^"\\]*"|'[^'\\]*')*)?
|
|
|
|
|
\s{re.escape(attribute)}\s*=\s*(?P<_q>['"])(?-x:{value_regex})(?P=_q)
|
|
|
|
|
'''
|
|
|
|
@ -263,7 +263,7 @@ class MatchingElementParser(HTMLTagParser):
|
|
|
|
|
def matchfunc(tag_str, _attrs):
|
|
|
|
|
return tag_str == tag
|
|
|
|
|
|
|
|
|
|
tag_regex = rf'''<\s*{re.escape(tag)}(?:\s(?:[^>"'\\]|"[^"\\]*"|'[^'\\]*')*)?>'''
|
|
|
|
|
tag_regex = rf'''<\s*(?i:{re.escape(tag)})(?:\s(?:[^>"'\\]|"[^"\\]*"|'[^'\\]*')*)?>'''
|
|
|
|
|
yield from cls.iter_tags(tag_regex, html, matchfunc=matchfunc)
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|