Parse style attributes for absolute URL paths (#5)

This commit is contained in:
Daniël van de Giessen
2026-04-01 12:00:00 +08:00
committed by yz-yu
parent c6552fbcca
commit 61c50c2122

View File

@@ -105,6 +105,8 @@ function serializeNode(n: Node, doc: Document): serializedNode | false {
// relative path in attribute
if (name === 'src' || name === 'href') {
attributes[name] = absoluteToDoc(doc, value);
} else if (name === 'style') {
attributes[name] = absoluteToStylesheet(value, doc.location.href);
} else {
attributes[name] = value;
}