🐛 建立索引时无法解析 v2.2.0- 版本的块引用 Fix https://github.com/siyuan-note/siyuan/issues/6889

This commit is contained in:
Liang Ding 2022-12-18 12:41:14 +08:00
parent 3943a5f024
commit b293571cb5
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 11 additions and 18 deletions

View file

@ -155,7 +155,7 @@ func prepareWriteTree(tree *parse.Tree) (data []byte, filePath string, err error
filePath = filepath.Join(util.DataDir, tree.Box, tree.Path)
if oldSpec := tree.Root.Spec; "" == oldSpec {
luteEngine.NestedInlines2FlattedSpans(tree)
parse.NestedInlines2FlattedSpans(tree)
tree.Root.Spec = "1"
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, tree.Root.Spec)
}
@ -236,7 +236,7 @@ func parseJSON2Tree(boxID, p string, jsonData []byte, luteEngine *lute.Lute) (re
filePath := filepath.Join(util.DataDir, ret.Box, ret.Path)
if oldSpec := ret.Root.Spec; "" == oldSpec {
luteEngine.NestedInlines2FlattedSpans(ret)
parse.NestedInlines2FlattedSpans(ret)
ret.Root.Spec = "1"
needFix = true
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)