From 2a839f90867ff0b3362faa2c69635c25b86d30f7 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 1 Apr 2025 01:19:39 +0800 Subject: [PATCH] :art: Trim space in dialynote/block ref/new doc save path https://github.com/siyuan-note/siyuan/issues/14482 --- kernel/model/file.go | 1 + kernel/model/path.go | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel/model/file.go b/kernel/model/file.go index c587b715c..60b568695 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -1080,6 +1080,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) { FlushTxQueue() + hPath = util.TrimSpaceInPath(hPath) existRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath) if nil != existRoot { existed = true diff --git a/kernel/model/path.go b/kernel/model/path.go index 7979ce4b4..d0ea6a2de 100644 --- a/kernel/model/path.go +++ b/kernel/model/path.go @@ -40,6 +40,7 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string) (retID string retID = id hPath = strings.TrimSuffix(hPath, ".sy") + hPath = util.TrimSpaceInPath(hPath) if "" != parentID { // The save path is incorrect when creating a sub-doc by ref in a doc with the same name https://github.com/siyuan-note/siyuan/issues/8138 // 在指定了父文档 ID 的情况下优先查找父文档