🎨 遗留的 Markdown 嵌套节点迁移为平铺的文本标记节点

This commit is contained in:
Liang Ding 2022-09-19 23:58:00 +08:00
parent 6851656c09
commit 7ede0cbf52
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 6 additions and 97 deletions

View file

@ -105,7 +105,7 @@ func WriteTree(tree *parse.Tree) (err error) {
filePath := filepath.Join(util.DataDir, tree.Box, tree.Path)
if oldSpec := tree.Root.Spec; "" == oldSpec {
treenode.NestedInlines2FlattedSpans(tree)
luteEngine.NestedInlines2FlattedSpans(tree)
tree.Root.Spec = "1"
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, tree.Root.Spec)
}
@ -190,7 +190,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 {
treenode.NestedInlines2FlattedSpans(ret)
luteEngine.NestedInlines2FlattedSpans(ret)
ret.Root.Spec = "1"
needFix = true
logging.LogInfof("migrated tree [%s] from spec [%s] to [%s]", filePath, oldSpec, ret.Root.Spec)