From 24994d993fdf4ccc29067360374720732584a78d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 3 Jan 2023 10:49:17 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=BC=95=E7=94=A8=E5=B5=8C=E5=A5=97?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=9D=97=E8=A7=A6=E5=8F=91=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20Fix=20https://github.com/siyuan-note/siyua?= =?UTF-8?q?n/issues/6967?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/sql/block_query.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kernel/sql/block_query.go b/kernel/sql/block_query.go index 134d4f956..3dba9bcda 100644 --- a/kernel/sql/block_query.go +++ b/kernel/sql/block_query.go @@ -656,10 +656,20 @@ func GetContainerText(container *ast.Node) string { return ast.WalkContinue } switch n.Type { - case ast.NodeText, ast.NodeLinkText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent: + case ast.NodeText, ast.NodeLinkText, ast.NodeFileAnnotationRefText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent: buf.Write(n.Tokens) case ast.NodeTextMark: buf.WriteString(n.Content()) + case ast.NodeBlockRef: + if anchor := n.ChildByType(ast.NodeBlockRefText); nil != anchor { + buf.WriteString(anchor.Text()) + } else if anchor = n.ChildByType(ast.NodeBlockRefDynamicText); nil != anchor { + buf.WriteString(anchor.Text()) + } else { + text := GetRefText(n.TokensStr()) + buf.WriteString(text) + } + return ast.WalkSkipChildren } return ast.WalkContinue })