From 54bfd09fdd9ab59cc62063e77e9f5417ad7081eb Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:40:24 +0800 Subject: [PATCH] fix: rehype2note code node conversion should preserve wrap fix: #1083 --- src/utils/convert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/convert.ts b/src/utils/convert.ts index f58d159..c5a8731 100644 --- a/src/utils/convert.ts +++ b/src/utils/convert.ts @@ -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"; } },