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/14200

Vanessa1939eaa03b76
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts
index 6ee5d02e57..32c1b205de 100644
--- a/app/src/util/newFile.ts
+++ b/app/src/util/newFile.ts
@@ -242,7 +242,7 @@ export const newFileByName = (app: App, value: string) => {
};
export const newFileBySelect = (protyle: IProtyle, selectText: string, nodeElement: HTMLElement, pathDir: string, targetNotebookId: string) => {
- const newFileName = replaceFileName(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML).replace(/\n/g, "")) || window.siyuan.languages.untitled;
+ const newFileName = replaceFileName(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML).replace(/\n/g, "").trim()) || window.siyuan.languages.untitled;
const hPath = pathPosix().join(pathDir, newFileName);
fetchPost("/api/filetree/getIDsByHPath", {
path: hPath,