fix crash if inline css doesnt have text children

This commit is contained in:
csd4ni3l
2025-07-23 00:19:33 +02:00
parent 1b200b65ad
commit d90a9fc174

View File

@@ -173,7 +173,8 @@ def get_inline_styles(node):
for node in node.children:
if isinstance(node, Element) and node.tag == "style":
all_rules.extend(CSSParser(node.children[0].text).parse()) # node's first children will just be a text element that contains the css
if isinstance(node.children[0], Text):
all_rules.extend(CSSParser(node.children[0].text).parse()) # node's first children will just be a text element that contains the css
all_rules.extend(get_inline_styles(node))