use value of the optiona when the content is empty (#4035)

This commit is contained in:
LawyZheng
2025-11-20 00:04:39 +08:00
committed by GitHub
parent 2253ca2004
commit 31a79a1313
3 changed files with 4 additions and 0 deletions

View File

@@ -152,6 +152,8 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:
# build option HTML
option_html = "".join(
f'<option index="{option.get("optionIndex")}">{option.get("text")}</option>'
if option.get("text")
else f'<option index="{option.get("optionIndex")}" value="{option.get("value")}">{option.get("text")}</option>'
for option in element.get("options", [])
)