🎨 搜索结果高亮支持大部分行级元素 https://github.com/siyuan-note/siyuan/issues/6745

This commit is contained in:
Liang Ding 2022-12-28 17:07:59 +08:00
parent 92b88154fb
commit 7c40b44a15
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 35 additions and 17 deletions

View file

@ -26,7 +26,6 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/html"
"github.com/88250/lute/parse"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/sql"
@ -124,6 +123,8 @@ func getNodeRefText(node *ast.Node) string {
func GetBlockRefIDs(id string) (refIDs, refTexts, defIDs []string) {
refIDs = []string{}
refTexts = []string{}
defIDs = []string{}
bt := treenode.GetBlockTree(id)
if nil == bt {
return
@ -237,9 +238,9 @@ func buildBlockBreadcrumb(node *ast.Node, excludeTypes []string) (ret []*BlockPa
fc = fc.Next
}
name := html.EscapeHTMLStr(parent.IALAttr("name"))
name := util.EscapeHTML(parent.IALAttr("name"))
if ast.NodeDocument == parent.Type {
name = html.EscapeHTMLStr(path.Join(boxName, hPath))
name = util.EscapeHTML(path.Join(boxName, hPath))
} else {
if "" == name {
if ast.NodeListItem == parent.Type {