diff --git a/kernel/sql/database.go b/kernel/sql/database.go index 66f21f710..2b6ce8fe6 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 4375f1a3c..7efe745fc 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: