From a4e61c8c37a85e6f7bb2be6dcac55a123ac75ec1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 3 Jul 2024 13:08:55 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11868 --- app/src/protyle/wysiwyg/keydown.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index f7fec9375..aa2e1c696 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -813,7 +813,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { // 段末反向删除 https://github.com/siyuan-note/insider/issues/274 if (position.end === editElement.textContent.length || // 软换行后删除 https://github.com/siyuan-note/siyuan/issues/11118 - (position.end === editElement.textContent.length - 1 && editElement.textContent.endsWith("\n"))) { + (position.end === editElement.textContent.length - 1 && editElement.textContent.endsWith("\n")) || + // 图片后无内容删除 https://github.com/siyuan-note/siyuan/issues/11868 + (position.end === editElement.textContent.length - 1 && editElement.textContent.endsWith(Constants.ZWSP))) { const nextElement = getNextBlock(getTopAloneElement(nodeElement)); if (nextElement) { const nextRange = focusBlock(nextElement);