瀏覽代碼

:art: fix https://github.com/siyuan-note/siyuan/issues/6107

Vanessa 2 年之前
父節點
當前提交
e2eca1186d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/src/protyle/wysiwyg/keydown.ts

+ 3 - 0
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"))) {
             if (!selectText.trim() && (nodeElement.querySelector("tr") || nodeElement.querySelector("span"))) {
                 // 没选中时,都是纯文本就创建子文档 https://ld246.com/article/1663073488381/comment/1664804353295#comments
                 // 没选中时,都是纯文本就创建子文档 https://ld246.com/article/1663073488381/comment/1664804353295#comments
             } else {
             } else {
+                if (!selectText.trim()) {
+                    selectAll(protyle, nodeElement, range);
+                }
                 newFileBySelect(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML), protyle);
                 newFileBySelect(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML), protyle);
             }
             }
             event.preventDefault();
             event.preventDefault();