close before open to make sure document was closed

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 7f03296b5f
commit 55ce53ffa0

View File

@@ -112,6 +112,8 @@ export function buildNodeWithSN(
} }
// use target document as root document // use target document as root document
if (n.type === NodeType.Document) { if (n.type === NodeType.Document) {
// close before open to make sure document was closed
doc.close();
doc.open(); doc.open();
node = doc; node = doc;
} }