From dff19ad0959c4531fac80da41c1c8d2e91880f43 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 7 Feb 2025 11:18:32 +0800 Subject: [PATCH] :recycle: https://github.com/siyuan-note/siyuan/pull/14008 --- app/src/protyle/wysiwyg/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index c9fe4bba0..3ea0ac8a6 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -416,9 +416,8 @@ export class WYSIWYG { html = tempElement.innerHTML; } // 不能使用 commonAncestorContainer https://ld246.com/article/1643282894693 - const codeBlockElement = hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock"); textPlain = tempElement.textContent; - if (codeBlockElement) { + if (hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock")) { if (range.endContainer.textContent.length === range.endOffset && (range.endContainer.parentElement.getAttribute("spellcheck") ? !range.endContainer.nextSibling : !range.endContainer.parentElement.nextSibling)) { textPlain = textPlain.replace(/\n$/, "");