🐛 Fix path retrieval in CreateWithMarkdown function (#16268)

fix https://github.com/siyuan-note/siyuan/issues/16026
This commit is contained in:
Jeffrey Chen 2025-11-03 11:02:38 +08:00 committed by GitHub
parent b1a00c6ebd
commit 15674d67f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}