Skip to content

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

:art: Trim space in dialynote/block ref/new doc save path https://github.com/siyuan-note/siyuan/issues/14482

Daniel2a839f90867f
diff --git a/kernel/model/file.go b/kernel/model/file.go
index c587b715cf..60b5686950 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 7979ce4b48..d0ea6a2deb 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 的情况下优先查找父文档