mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Assets hyperlinks are no longer included in the search index Fix https://github.com/siyuan-note/siyuan/issues/8076
This commit is contained in:
parent
41ef76ed74
commit
554f2f9fbc
1 changed files with 10 additions and 4 deletions
|
|
@ -185,9 +185,11 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
|
||||||
buf.WriteByte(' ')
|
buf.WriteByte(' ')
|
||||||
}
|
}
|
||||||
if nil != linkDest {
|
if nil != linkDest {
|
||||||
buf.Write(linkDest.Tokens)
|
if !bytes.HasPrefix(linkDest.Tokens, []byte("assets/")) {
|
||||||
buf.WriteByte(' ')
|
// Assets hyperlinks are no longer included in the search index https://github.com/siyuan-note/siyuan/issues/8076
|
||||||
|
buf.Write(linkDest.Tokens)
|
||||||
|
buf.WriteByte(' ')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if linkTitle := n.ChildByType(ast.NodeLinkTitle); nil != linkTitle {
|
if linkTitle := n.ChildByType(ast.NodeLinkTitle); nil != linkTitle {
|
||||||
buf.Write(linkTitle.Tokens)
|
buf.Write(linkTitle.Tokens)
|
||||||
|
|
@ -229,7 +231,11 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
|
||||||
if "" != n.TextMarkATitle {
|
if "" != n.TextMarkATitle {
|
||||||
buf.WriteString(" " + n.TextMarkATitle)
|
buf.WriteString(" " + n.TextMarkATitle)
|
||||||
}
|
}
|
||||||
buf.WriteString(" " + n.TextMarkAHref)
|
|
||||||
|
if !strings.HasPrefix(n.TextMarkAHref, "assets/") {
|
||||||
|
// Assets hyperlinks are no longer included in the search index https://github.com/siyuan-note/siyuan/issues/8076
|
||||||
|
buf.WriteString(" " + n.TextMarkAHref)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case ast.NodeBackslash:
|
case ast.NodeBackslash:
|
||||||
buf.WriteByte(lex.ItemBackslash)
|
buf.WriteByte(lex.ItemBackslash)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue