File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -73,21 +73,21 @@ def intercept_anchor_links(vdom_tree: VdomDict) -> VdomDict:
73
73
return vdom_tree
74
74
75
75
76
- def _find_selected_options (vdom_tree : VdomDict | Any ) -> list [str ]:
76
+ def _find_selected_options (vdom_node : Any ) -> list [str ]:
77
77
"""Recursively iterate through the tree to find all <option> tags with the 'selected' prop.
78
78
Removes the 'selected' prop and returns a list of the 'value' prop of each selected <option>."""
79
- if not isinstance (vdom_tree , dict ):
79
+ if not isinstance (vdom_node , dict ):
80
80
return []
81
81
82
82
selected_options = []
83
- if vdom_tree ["tagName" ] == "option" and "attributes" in vdom_tree :
84
- value = vdom_tree ["attributes" ].setdefault ("value" , vdom_tree ["children" ][0 ])
83
+ if vdom_node ["tagName" ] == "option" and "attributes" in vdom_node :
84
+ value = vdom_node ["attributes" ].setdefault ("value" , vdom_node ["children" ][0 ])
85
85
86
- if "selected" in vdom_tree ["attributes" ]:
87
- vdom_tree ["attributes" ].pop ("selected" )
86
+ if "selected" in vdom_node ["attributes" ]:
87
+ vdom_node ["attributes" ].pop ("selected" )
88
88
selected_options .append (value )
89
89
90
- for child in vdom_tree .get ("children" , []):
90
+ for child in vdom_node .get ("children" , []):
91
91
selected_options .extend (_find_selected_options (child ))
92
92
93
93
return selected_options
You can’t perform that action at this time.
0 commit comments