Commit rapidand script, truncate dom element name length to max 500 characters (#1316)

This commit is contained in:
Shuchang Zheng
2024-12-03 23:33:45 -08:00
committed by GitHub
parent 8e14a6bd2f
commit 3b2e2de197

View File

@@ -668,6 +668,13 @@ def trim_element(element: dict) -> dict:
if not element_text:
del queue_ele["text"]
if (
"attributes" in queue_ele
and "name" in queue_ele["attributes"]
and len(queue_ele["attributes"]["name"]) > 500
):
queue_ele["attributes"]["name"] = queue_ele["attributes"]["name"][:500]
if "beforePseudoText" in queue_ele and not queue_ele.get("beforePseudoText"):
del queue_ele["beforePseudoText"]