Skip to content

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

:bug: Fix https://github.com/siyuan-note/siyuan/issues/17126

Daniele92cc285a677
diff --git a/app/src/util/mount.ts b/app/src/util/mount.ts
index 26157dec54..5d3bb64380 100644
--- a/app/src/util/mount.ts
+++ b/app/src/util/mount.ts
@@ -4,7 +4,7 @@ import {isMobile} from "./functions";
import {fetchPost} from "./fetch";
import {Dialog} from "../dialog";
import {getOpenNotebookCount} from "./pathName";
-import {validateName} from "../editor/rename";
+import {replaceFileName, validateName} from "../editor/rename";
import {setStorageVal} from "../protyle/util/compatibility";
import {openFileById} from "../editor/util";
import {openMobileFileById} from "../mobile/editor";
@@ -123,10 +123,11 @@ export const newNotebook = () => {
dialog.destroy();
});
btnsElement[1].addEventListener("click", () => {
- const name = dialog.element.querySelector("input").value;
+ let name = dialog.element.querySelector("input").value;
if (!validateName(name)) {
return false;
}
+ name = replaceFileName(name);
fetchPost("/api/notebook/createNotebook", {
name
});