From 95ae0c39c9400a85d587b58e9e9d746445151259 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 24 Oct 2022 11:24:13 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=9B=BE=E8=A1=A8=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=9C=A8=E6=95=B0=E6=8D=AE=E5=BA=93=20`block?= =?UTF-8?q?s`=20=E8=A1=A8=20`content`=20=E5=AD=97=E6=AE=B5=E4=B8=AD?= =?UTF-8?q?=E8=A2=AB=E8=BD=AC=E4=B9=89=20Fix=20https://github.com/siyuan-n?= =?UTF-8?q?ote/siyuan/issues/6326?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/treenode/node.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/treenode/node.go b/kernel/treenode/node.go index a01d7e91b..3c8b69774 100644 --- a/kernel/treenode/node.go +++ b/kernel/treenode/node.go @@ -142,7 +142,12 @@ func NodeStaticContent(node *ast.Node) string { buf.Write(n.Tokens) case ast.NodeText, ast.NodeFileAnnotationRefText, ast.NodeFootnotesRef, ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent, ast.NodeHTMLBlock: - buf.Write(n.Tokens) + tokens := n.Tokens + if IsChartCodeBlockCode(n) { + // 图表块的内容在数据库 `blocks` 表 `content` 字段中被转义 https://github.com/siyuan-note/siyuan/issues/6326 + tokens = html.UnescapeHTML(tokens) + } + buf.Write(tokens) case ast.NodeTextMark: if n.IsTextMarkType("tag") { buf.WriteByte('#')