From 15674d67f7d3ff564a0de04712c79b89217f94d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:02:38 +0800 Subject: [PATCH] :bug: Fix path retrieval in CreateWithMarkdown function (#16268) fix https://github.com/siyuan-note/siyuan/issues/16026 --- kernel/model/file.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 42c7c87cb..4685ff3ce 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -1073,7 +1073,12 @@ func CreateWithMarkdown(tags, boxID, hPath, md, parentID, id string, withMath bo SetBlockAttrs(retID, nameValues) FlushTxQueue() - box.addMinSort(path.Dir(hPath), retID) + docPath, _, err := GetPathByID(retID) + if err != nil { + logging.LogWarnf("get path by id [%s] failed: %s", retID, err) + return + } + box.addMinSort(path.Dir(docPath), retID) return }