Not found group problem fixed

This commit is contained in:
Kiryl
2022-06-21 17:10:32 +03:00
parent 131fa2642e
commit 4b74faef05

View File

@@ -201,7 +201,7 @@ class TagStyleConverter:
# if we find styles that cannot be in <tag.name> -> wrap them in span
tag = BeautifulSoup(features="lxml").new_tag(f"{initial_tag.name}")
style = ""
possible_attrs_regexp = [re.compile(fr"{style}: *\w+;") for style in styles_can_be_in_tag]
possible_attrs_regexp = [re.compile(fr"({style}: *\w+;)") for style in styles_can_be_in_tag]
for possible_attr_regexp in possible_attrs_regexp:
has_style_attrs = re.search(
possible_attr_regexp, span_style)