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 1/2] :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) } From f870ff44d22df7dffb05626fa9000da9540088b7 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 6 Oct 2023 22:43:21 +0800 Subject: [PATCH 2/2] :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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/blockinfo.go b/kernel/model/blockinfo.go index eb387abb1..7f3163b4a 100644 --- a/kernel/model/blockinfo.go +++ b/kernel/model/blockinfo.go @@ -115,13 +115,13 @@ func GetBlockRefText(id string) string { 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") { + // Block ref anchor text no longer contains contents of inline-level memos https://github.com/siyuan-note/siyuan/issues/9363 n.TextMarkInlineMemoContent = "" return ast.WalkContinue }