mirror of
https://github.com/csd4ni3l/browser.git
synced 2026-01-01 04:03:43 +01:00
fix crash if inline css doesnt have text children
This commit is contained in:
@@ -173,6 +173,7 @@ def get_inline_styles(node):
|
|||||||
|
|
||||||
for node in node.children:
|
for node in node.children:
|
||||||
if isinstance(node, Element) and node.tag == "style":
|
if isinstance(node, Element) and node.tag == "style":
|
||||||
|
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(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))
|
all_rules.extend(get_inline_styles(node))
|
||||||
|
|||||||
Reference in New Issue
Block a user