From e92cc285a677ab7d29d8ba125348f6b94adca9b9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 3 Mar 2026 16:50:04 +0800 Subject: [PATCH] :bug: Fix https://github.com/siyuan-note/siyuan/issues/17126 Signed-off-by: Daniel <845765@qq.com> --- app/src/util/mount.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/util/mount.ts b/app/src/util/mount.ts index 26157dec5..5d3bb6438 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 });