🐛 Wrong parsing virtual reference with \ before it Fix https://github.com/siyuan-note/siyuan/issues/7821

This commit is contained in:
Liang Ding 2023-03-29 18:16:15 +08:00
parent 1b8f59a898
commit 6f8683de5f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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