From 7c1bec64f26b42a49a254c34213031569804e58c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 29 Apr 2025 11:01:54 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14290 --- app/src/protyle/wysiwyg/getBlock.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/getBlock.ts b/app/src/protyle/wysiwyg/getBlock.ts index df46bfd3d..cb6a67d9a 100644 --- a/app/src/protyle/wysiwyg/getBlock.ts +++ b/app/src/protyle/wysiwyg/getBlock.ts @@ -177,8 +177,14 @@ export const isEndOfBlock = (range: Range) => { } while (nextSibling) { - if (hasNextSibling(nextSibling)) { - return false; + const nextNextSibling = hasNextSibling(nextSibling); + if (nextNextSibling) { + // 行内元素后为 \n https://github.com/siyuan-note/siyuan/issues/14290#issuecomment-2833372579 + if (nextNextSibling.nodeType === 3 && (nextNextSibling as Text).wholeText === "\n") { + nextSibling = nextNextSibling; + } else { + return false; + } } else { if (nextSibling.parentElement.getAttribute("spellcheck")) { return true;