mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 Find replace supports selecting element types https://github.com/siyuan-note/siyuan/issues/9895
This commit is contained in:
parent
d54fe4fe24
commit
23a24b28e6
3 changed files with 203 additions and 54 deletions
|
|
@ -81,7 +81,18 @@ func findReplace(c *gin.Context) {
|
|||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
err := model.FindReplace(k, r, ids, paths, boxes, types, method, orderBy, groupBy)
|
||||
|
||||
replaceTypes := map[string]bool{}
|
||||
// text, img-text, img-title, img-src, a-text, a-title, a-href, code, em, strong, inline-math, inline-memo, kbd, mark, s, sub, sup, tag, u
|
||||
// doc-title, code-block, math-block, html-block
|
||||
if nil != arg["replaceTypes"] {
|
||||
replaceTypesArg := arg["replaceTypes"].(map[string]interface{})
|
||||
for t, b := range replaceTypesArg {
|
||||
replaceTypes[t] = b.(bool)
|
||||
}
|
||||
}
|
||||
|
||||
err := model.FindReplace(k, r, replaceTypes, ids, paths, boxes, types, method, orderBy, groupBy)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue