From 3a43c976843aacf75f91732405571bc7d07ef2e3 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 20 Sep 2022 11:38:36 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=A0=87=E7=AD=BE=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20https://github.com/siyuan-note/insider/iss?= =?UTF-8?q?ues/1064?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/sql/database.go | 6 ++++++ kernel/treenode/node.go | 6 ++++++ 2 files changed, 12 insertions(+) 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: