fix: rehype2note code node conversion should preserve wrap

fix: #1083
This commit is contained in:
windingwind 2024-08-23 18:40:24 +08:00
parent 0ecc74a6e8
commit 54bfd09fdd

View File

@ -567,7 +567,7 @@ function rehype2note(rehype: HRoot) {
? ancestors[ancestors.length - 1]
: undefined;
if (parent?.type == "element" && parent?.tagName === "pre") {
node.value = toText(node);
node.value = toText(node, { whitespace: "pre-wrap" });
node.type = "text";
}
},