mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 14:49:58 +08:00
🎨 Fix tree id https://github.com/siyuan-note/siyuan/issues/14363
This commit is contained in:
parent
6407791fbb
commit
8418e3a454
@ -278,6 +278,15 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
|
||||
needFix = true
|
||||
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)
|
||||
}
|
||||
|
||||
if pathID := util.GetTreeID(p); pathID != ret.Root.ID {
|
||||
needFix = true
|
||||
ret.Root.ID = pathID
|
||||
ret.ID = pathID
|
||||
ret.Root.SetIALAttr("id", ret.ID)
|
||||
logging.LogInfof("reset tree id from [%s] to [%s]", ret.Root.ID, pathID)
|
||||
}
|
||||
|
||||
if needFix {
|
||||
renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions)
|
||||
data := renderer.Render()
|
||||
|
Loading…
Reference in New Issue
Block a user