This commit is contained in:
Liang Ding 2022-09-15 15:38:09 +08:00
parent a481841495
commit a8bc7a0575
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 94 additions and 1 deletions

View file

@ -614,7 +614,7 @@ func GetDoc(startID, endID, id string, index int, keyword string, mode int, size
}
}
subTree := &parse.Tree{Root: &ast.Node{Type: ast.NodeDocument}, Marks: tree.Marks}
subTree := &parse.Tree{ID: rootID, Root: &ast.Node{Type: ast.NodeDocument}, Marks: tree.Marks}
keyword = strings.Join(strings.Split(keyword, " "), search.TermSep)
keywords := search.SplitKeyword(keyword)
@ -728,6 +728,8 @@ 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