mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Fix tree id https://github.com/siyuan-note/siyuan/issues/14363
This commit is contained in:
parent
6407791fbb
commit
8418e3a454
1 changed files with 9 additions and 0 deletions
|
|
@ -278,6 +278,15 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
|
||||||
needFix = true
|
needFix = true
|
||||||
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)
|
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 {
|
if needFix {
|
||||||
renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions)
|
renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions)
|
||||||
data := renderer.Render()
|
data := renderer.Render()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue