🎨 Find replace supports HTML blocks Fix https://github.com/siyuan-note/siyuan/issues/9539

This commit is contained in:
Daniel 2023-10-28 22:46:28 +08:00
parent 5d2be98eab
commit ec629d8e9b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -334,7 +334,7 @@ func FindReplace(keyword, replacement string, ids []string, paths, boxes []strin
}
switch n.Type {
case ast.NodeText, ast.NodeLinkDest, ast.NodeLinkText, ast.NodeLinkTitle, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
case ast.NodeText, ast.NodeLinkDest, ast.NodeLinkText, ast.NodeLinkTitle, ast.NodeCodeBlockCode, ast.NodeMathBlockContent, ast.NodeHTMLBlock:
if 0 == method {
if bytes.Contains(n.Tokens, []byte(keyword)) {
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte(keyword), []byte(replacement))