setup tests

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent a71fb73aaf
commit ed2bc918e0
9 changed files with 169 additions and 7 deletions

View File

@@ -14,7 +14,11 @@ function buildNode(n: serializedNodeWithId): Node | null {
const node = document.createElement(n.tagName);
for (const name in n.attributes) {
if (n.attributes.hasOwnProperty(name)) {
node.setAttribute(name, n.attributes[name]);
try {
node.setAttribute(name, n.attributes[name]);
} catch (error) {
// skip invalid attribute
}
}
}
return node;