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 的情况下优先查找父文档