Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Vanessafbf7d1f1747f
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index ce93fc323f..473a3c3b13 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1065,7 +1065,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()) {
+ if (!selectText.trim() &&
+ getContenteditableElement(nodeElement).textContent // https://github.com/siyuan-note/siyuan/issues/8099
+ ) {
selectAll(protyle, nodeElement, range);
}
const newFileName = replaceFileName(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML).replace(/\n/g, "")) || "Untitled";