diff --git a/kernel/model/search.go b/kernel/model/search.go index 0f11a4dc1..de95a1779 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -910,6 +910,23 @@ func markReplaceSpan(n *ast.Node, unlinks *[]*ast.Node, keywords []string, markS c.Type = ast.NodeTextMark c.TextMarkType = n.TextMarkType c.TextMarkTextContent = string(c.Tokens) + if n.IsTextMarkType("a") { + c.TextMarkAHref, c.TextMarkATitle = n.TextMarkAHref, n.TextMarkATitle + } else if n.IsTextMarkType("block-ref") { + c.TextMarkBlockRefID = n.TextMarkBlockRefID + c.TextMarkBlockRefSubtype = n.TextMarkBlockRefSubtype + } else if n.IsTextMarkType("file-annotation-ref") { + c.TextMarkFileAnnotationRefID = n.TextMarkFileAnnotationRefID + } + } else if ast.NodeTextMark == c.Type { + if n.IsTextMarkType("a") { + c.TextMarkAHref, c.TextMarkATitle = n.TextMarkAHref, n.TextMarkATitle + } else if n.IsTextMarkType("block-ref") { + c.TextMarkBlockRefID = n.TextMarkBlockRefID + c.TextMarkBlockRefSubtype = n.TextMarkBlockRefSubtype + } else if n.IsTextMarkType("file-annotation-ref") { + c.TextMarkFileAnnotationRefID = n.TextMarkFileAnnotationRefID + } } children = append(children, c)