mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 19:18:06 +01:00
🎨 Find-replace support file annotation ref elements https://github.com/siyuan-note/siyuan/issues/13013
This commit is contained in:
parent
4e6651c46e
commit
fa2f8ed7e5
16 changed files with 58 additions and 26 deletions
|
|
@ -767,6 +767,20 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
|
|||
n.TextMarkBlockRefSubtype = "s"
|
||||
}
|
||||
}
|
||||
} else if n.IsTextMarkType("file-annotation-ref") {
|
||||
if !replaceTypes["fileAnnotationRef"] {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
if 0 == method {
|
||||
if strings.Contains(n.TextMarkTextContent, keyword) {
|
||||
n.TextMarkTextContent = strings.ReplaceAll(n.TextMarkTextContent, keyword, replacement)
|
||||
}
|
||||
} else if 3 == method {
|
||||
if nil != r && r.MatchString(n.TextMarkTextContent) {
|
||||
n.TextMarkTextContent = r.ReplaceAllString(n.TextMarkTextContent, replacement)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ast.WalkContinue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue