🎨 搜索替换支持块引锚文本 Fix https://github.com/siyuan-note/siyuan/issues/5903
This commit is contained in:
parent
edfb645f3a
commit
afe14a990f
1 changed files with 5 additions and 1 deletions
|
@ -166,9 +166,13 @@ func FindReplace(keyword, replacement string, ids []string) (err error) {
|
|||
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte(keyword), []byte(replacement))
|
||||
}
|
||||
case ast.NodeTextMark:
|
||||
if strings.Contains(n.TextMarkTextContent, keyword) || strings.Contains(n.TextMarkInlineMathContent, keyword) || strings.Contains(n.TextMarkInlineMemoContent, keyword) {
|
||||
if strings.Contains(n.TextMarkTextContent, keyword) {
|
||||
n.TextMarkTextContent = strings.ReplaceAll(n.TextMarkTextContent, keyword, replacement)
|
||||
}
|
||||
if strings.Contains(n.TextMarkInlineMathContent, keyword) {
|
||||
n.TextMarkInlineMathContent = strings.ReplaceAll(n.TextMarkInlineMathContent, keyword, replacement)
|
||||
}
|
||||
if strings.Contains(n.TextMarkInlineMemoContent, keyword) {
|
||||
n.TextMarkInlineMemoContent = strings.ReplaceAll(n.TextMarkInlineMemoContent, keyword, replacement)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue