Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 标签系统异常 https://github.com/siyuan-note/insider/issues/1064

Liang Ding3a43c976843a
diff --git a/kernel/sql/database.go b/kernel/sql/database.go
index 66f21f710b..2b6ce8fe68 100644
--- a/kernel/sql/database.go
+++ b/kernel/sql/database.go
@@ -402,7 +402,13 @@ func resolveRefContent0(node *ast.Node, anchors *map[string]string, depth *int,
ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
buf.Write(n.Tokens)
case ast.NodeTextMark:
+ if n.IsTextMarkType("tag") {
+ buf.WriteByte('#')
+ }
buf.WriteString(n.Content())
+ if n.IsTextMarkType("tag") {
+ buf.WriteByte('#')
+ }
case ast.NodeBlockRef:
if anchor := n.ChildByType(ast.NodeBlockRefText); nil != anchor {
buf.WriteString(anchor.Text())
diff --git a/kernel/treenode/node.go b/kernel/treenode/node.go
index 4375f1a3c5..7efe745fce 100644
--- a/kernel/treenode/node.go
+++ b/kernel/treenode/node.go
@@ -143,7 +143,13 @@ func NodeStaticContent(node *ast.Node) string {
ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent, ast.NodeHTMLBlock:
buf.Write(n.Tokens)
case ast.NodeTextMark:
+ if n.IsTextMarkType("tag") {
+ buf.WriteByte('#')
+ }
buf.WriteString(n.Content())
+ if n.IsTextMarkType("tag") {
+ buf.WriteByte('#')
+ }
case ast.NodeBackslash:
buf.WriteByte(lex.ItemBackslash)
case ast.NodeBackslashContent: