Skip to content

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

:art: 行级元素支持嵌套和交叉 https://github.com/siyuan-note/siyuan/issues/2911

Liang Ding11d5a3b59fd9
diff --git a/kernel/filesys/tree.go b/kernel/filesys/tree.go
index d91b8c4748..789d2fb244 100644
--- a/kernel/filesys/tree.go
+++ b/kernel/filesys/tree.go
@@ -103,10 +103,11 @@ func WriteTree(tree *parse.Tree) (err error) {
treenode.ReindexBlockTree(tree)
}
+ filePath := filepath.Join(util.DataDir, tree.Box, tree.Path)
if oldSpec := tree.Root.Spec; "" == oldSpec {
treenode.NestedInlines2FlattedSpans(tree)
tree.Root.Spec = "1"
- logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", tree.Root.ID, oldSpec, tree.Root.Spec)
+ logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, tree.Root.Spec)
}
renderer := render.NewJSONRenderer(tree, luteEngine.RenderOptions)
output := renderer.Render()
@@ -119,7 +120,6 @@ func WriteTree(tree *parse.Tree) (err error) {
}
output = buf.Bytes()
- filePath := filepath.Join(util.DataDir, tree.Box, tree.Path)
if err = os.MkdirAll(filepath.Dir(filePath), 0755); nil != err {
return
}
@@ -186,11 +186,13 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
ret.Box = boxID
ret.Path = p
+
+ filePath := filepath.Join(util.DataDir, ret.Box, ret.Path)
if oldSpec := ret.Root.Spec; "" == oldSpec {
treenode.NestedInlines2FlattedSpans(ret)
ret.Root.Spec = "1"
needFix = true
- logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", ret.Root.ID, oldSpec, ret.Root.Spec)
+ logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)
}
if needFix {
renderer := render.NewJSONRenderer(ret, luteEngine.RenderOptions)
@@ -203,7 +205,6 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
}
output = buf.Bytes()
- filePath := filepath.Join(util.DataDir, ret.Box, ret.Path)
if err = os.MkdirAll(filepath.Dir(filePath), 0755); nil != err {
return
}