Fix inline link elements bug (#995)

* fix: bug when inlined link elements

* test: update snapshot for test cases

* apply Justin's review suggestions

1. make Mirror's replace function act the same with the original one when there's no existed node to get replaced.
2. when replacing with the link/style elements, keep their existing attributes to prevent potential bugs
This commit is contained in:
MF
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 4e241acc6d
commit 1f6e847e55
8 changed files with 117 additions and 48 deletions

View File

@@ -1165,7 +1165,6 @@ export function serializeNodeWithId(
},
stylesheetLoadTimeout,
);
if (isStylesheetLoaded(n as HTMLLinkElement) === false) return null; // add stylesheet in later mutation
}
return serializedNode;