Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/8138

Vanessa661d8b3d81fc
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index 06eff5de71..cfc57560c4 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -474,6 +474,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
fetchPost("/api/filetree/createDocWithMd", {
notebook: protyle.notebookId,
path: pathPosix().join(pathString, realFileName),
+ parentID: protyle.block.rootID,
markdown: ""
}, response => {
protyle.toolbar.setInlineMark(protyle, "block-ref", "range", {
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 4b9f8604e4..35712b873c 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1078,6 +1078,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
fetchPost("/api/filetree/createDocWithMd", {
notebook: protyle.notebookId,
path: pathPosix().join(response.data, newFileName),
+ parentID: protyle.block.rootID,
markdown: ""
}, response => {
insertHTML(`<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`, protyle);
@@ -1102,6 +1103,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
fetchPost("/api/filetree/createDocWithMd", {
notebook: protyle.notebookId,
path: pathPosix().join(pathString, newFileName),
+ parentID: protyle.block.rootID,
markdown: ""
}, response => {
insertHTML(`<span data-type="block-ref" data-id="${response.data}" data-subtype="d">${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}</span>`, protyle);