mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve find-replace for inline-memo https://github.com/siyuan-note/siyuan/issues/13707
This commit is contained in:
parent
43d3566876
commit
bb55ac1306
1 changed files with 6 additions and 0 deletions
|
@ -790,12 +790,18 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
|
|||
if 0 == method {
|
||||
if strings.Contains(n.TextMarkInlineMemoContent, keyword) {
|
||||
n.TextMarkInlineMemoContent = strings.ReplaceAll(n.TextMarkInlineMemoContent, keyword, replacement)
|
||||
n.TextMarkTextContent = strings.ReplaceAll(n.TextMarkTextContent, keyword, replacement)
|
||||
}
|
||||
} else if 3 == method {
|
||||
if nil != r && r.MatchString(n.TextMarkInlineMemoContent) {
|
||||
n.TextMarkInlineMemoContent = r.ReplaceAllString(n.TextMarkInlineMemoContent, replacement)
|
||||
n.TextMarkTextContent = r.ReplaceAllString(n.TextMarkTextContent, replacement)
|
||||
}
|
||||
}
|
||||
|
||||
if "" == n.TextMarkTextContent {
|
||||
unlinks = append(unlinks, n)
|
||||
}
|
||||
} else if n.IsTextMarkType("text") {
|
||||
// Search and replace fails in some cases https://github.com/siyuan-note/siyuan/issues/10016
|
||||
if !replaceTypes["text"] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue