File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 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:
7373 return vdom_tree
7474
7575
76- def _find_selected_options (vdom_tree : VdomDict | Any ) -> list [str ]:
76+ def _find_selected_options (vdom_node : Any ) -> list [str ]:
7777 """Recursively iterate through the tree to find all <option> tags with the 'selected' prop.
7878 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 ):
8080 return []
8181
8282 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 ])
8585
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" )
8888 selected_options .append (value )
8989
90- for child in vdom_tree .get ("children" , []):
90+ for child in vdom_node .get ("children" , []):
9191 selected_options .extend (_find_selected_options (child ))
9292
9393 return selected_options
You can’t perform that action at this time.
0 commit comments