mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 04:02:58 +08:00
🎨 Improve find-replace of text containing escape characters https://github.com/siyuan-note/siyuan/issues/14173
This commit is contained in:
parent
732e4ad329
commit
b6eea4b397
@ -590,6 +590,12 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
|
|||||||
if replaceTextNode(n, method, keyword, replacement, r, luteEngine) {
|
if replaceTextNode(n, method, keyword, replacement, r, luteEngine) {
|
||||||
if nil != n.Parent && ast.NodeBackslash == n.Parent.Type {
|
if nil != n.Parent && ast.NodeBackslash == n.Parent.Type {
|
||||||
unlinks = append(unlinks, n.Parent)
|
unlinks = append(unlinks, n.Parent)
|
||||||
|
|
||||||
|
prev, next := n.Parent.Previous, n.Parent.Next
|
||||||
|
if nil != prev && ast.NodeText == prev.Type && nil != next && ast.NodeText == next.Type {
|
||||||
|
prev.Tokens = append(prev.Tokens, next.Tokens...)
|
||||||
|
unlinks = append(unlinks, next)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
unlinks = append(unlinks, n)
|
unlinks = append(unlinks, n)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user