Explorar o código

:bug: 搜索不到超链接元素的 URL 和标题 Fix https://github.com/siyuan-note/siyuan/issues/7352

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
0d0cea11c9
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      kernel/treenode/node.go

+ 7 - 0
kernel/treenode/node.go

@@ -225,6 +225,13 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string) string {
 			if n.IsTextMarkType("tag") {
 				buf.WriteByte('#')
 			}
+			if n.IsTextMarkType("a") {
+				// 搜索不到超链接元素的 URL 和标题 https://github.com/siyuan-note/siyuan/issues/7352
+				if "" != n.TextMarkATitle {
+					buf.WriteString(" " + n.TextMarkATitle)
+				}
+				buf.WriteString(" " + n.TextMarkAHref)
+			}
 		case ast.NodeBackslash:
 			buf.WriteByte(lex.ItemBackslash)
 		case ast.NodeBackslashContent: