From 75dd676b56c4ccf83e7bf72b7d13d028a70a1034 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 6 Oct 2023 22:43:10 +0800 Subject: [PATCH] :art: Block ref anchor text no longer contains contents of inline-level memos https://github.com/siyuan-note/siyuan/issues/9363 --- kernel/model/blockinfo.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/model/blockinfo.go b/kernel/model/blockinfo.go index 45d27f8a4..eb387abb1 100644 --- a/kernel/model/blockinfo.go +++ b/kernel/model/blockinfo.go @@ -114,6 +114,19 @@ func GetBlockRefText(id string) string { if nil == node { return ErrBlockNotFound.Error() } + + // Block ref anchor text no longer contains contents of inline-level memos https://github.com/siyuan-note/siyuan/issues/9363 + ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus { + if !entering { + return ast.WalkContinue + } + + if n.IsTextMarkType("inline-memo") { + n.TextMarkInlineMemoContent = "" + return ast.WalkContinue + } + return ast.WalkContinue + }) return getNodeRefText(node) }