This commit is contained in:
Liang Ding 2022-09-15 19:40:50 +08:00
parent b06f074f1b
commit f7520a3f12
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 20 additions and 8 deletions

View file

@ -728,8 +728,6 @@ func GetDoc(startID, endID, id string, index int, keyword string, mode int, size
subTree.Root.AppendChild(n)
}
treenode.NestedInlines2FlattedSpans(subTree)
luteEngine.RenderOptions.NodeIndexStart = index
dom = luteEngine.Tree2BlockDOM(subTree, luteEngine.RenderOptions)
return

View file

@ -144,6 +144,10 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
// 写回 .sy
for _, tree := range trees {
syPath := filepath.Join(unzipRootPath, tree.Path)
if "" == tree.Root.Spec {
treenode.NestedInlines2FlattedSpans(tree)
tree.Root.Spec = "1"
}
renderer := render.NewJSONRenderer(tree, luteEngine.RenderOptions)
data := renderer.Render()
@ -451,6 +455,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
tree.Path = targetPath
targetPaths[curRelPath] = targetPath
tree.HPath = hPath
tree.Root.Spec = "1"
treenode.NestedInlines2FlattedSpans(tree)
docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath))