From e2eca1186d7cf93f27c9f7139d10fe7d151d955e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 9 Oct 2022 09:10:51 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6107 --- app/src/protyle/wysiwyg/keydown.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index a51d7273f..33d82c483 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1020,6 +1020,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { if (!selectText.trim() && (nodeElement.querySelector("tr") || nodeElement.querySelector("span"))) { // 没选中时,都是纯文本就创建子文档 https://ld246.com/article/1663073488381/comment/1664804353295#comments } else { + if (!selectText.trim()) { + selectAll(protyle, nodeElement, range); + } newFileBySelect(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML), protyle); } event.preventDefault();