diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index b1dd6e9ea..86cc1c908 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -853,8 +853,19 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { let nextSibling = hasNextSibling(range.startContainer) as Element; if (nextSibling) { if (nextSibling.nodeType === 3 && nextSibling.textContent === Constants.ZWSP) { + if (!nextSibling.nextSibling) { + // https://github.com/siyuan-note/siyuan/issues/13524 + const nextBlockElement = getNextBlock(nodeElement) + if (nextBlockElement) { + removeBlock(protyle, nextBlockElement, range, "remove"); + } + event.stopPropagation(); + event.preventDefault(); + return; + } nextSibling = nextSibling.nextSibling as Element; } + if (nextSibling.nodeType === 1 && nextSibling.classList.contains("img")) { // 光标需在图片前 https://github.com/siyuan-note/siyuan/issues/12452 const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range);