From d4e23f81fc590c9614e5e461b06c83622a7ad459 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 26 Nov 2025 18:06:19 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/16214 --- app/src/protyle/wysiwyg/getBlock.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/protyle/wysiwyg/getBlock.ts b/app/src/protyle/wysiwyg/getBlock.ts index f445dfcb5..196e127fe 100644 --- a/app/src/protyle/wysiwyg/getBlock.ts +++ b/app/src/protyle/wysiwyg/getBlock.ts @@ -184,6 +184,15 @@ export const isEndOfBlock = (range: Range) => { let nextSibling = range.endContainer; if (range.endContainer.nodeType !== 3) { nextSibling = range.endContainer.childNodes[range.endOffset]; + if (!nextSibling) { + // https://github.com/siyuan-note/siyuan/issues/16214 + if (range.endContainer.parentElement.getAttribute("spellcheck")) { + nextSibling = range.endContainer; + } + } else if (nextSibling.nodeType === 3 && !range.endContainer.childNodes[range.endOffset + 1]) { + // https://github.com/siyuan-note/siyuan/issues/16227 + return nextSibling.textContent === Constants.ZWSP || nextSibling.textContent === "\n"; + } } while (nextSibling) {