From 6f8683de5fb9d9e784ea0ab131026596faa8a6f0 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 29 Mar 2023 18:16:15 +0800 Subject: [PATCH] :bug: Wrong parsing virtual reference with `\` before it Fix https://github.com/siyuan-note/siyuan/issues/7821 --- kernel/model/virutalref.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/model/virutalref.go b/kernel/model/virutalref.go index d0ca24d44..5c1c8698c 100644 --- a/kernel/model/virutalref.go +++ b/kernel/model/virutalref.go @@ -157,6 +157,8 @@ func processVirtualRef(n *ast.Node, unlinks *[]*ast.Node, virtualBlockRefKeyword } } + // Wrong parsing virtual reference with `\` before it https://github.com/siyuan-note/siyuan/issues/7821 + newContent = strings.ReplaceAll(newContent, "\\"+search.GetMarkSpanStart(search.VirtualBlockRefDataType), "\\\\"+search.GetMarkSpanStart(search.VirtualBlockRefDataType)) n.Tokens = []byte(newContent) linkTree := parse.Inline("", n.Tokens, luteEngine.ParseOptions) var children []*ast.Node