🐛 查找替换中使用正则表达式后替换不正确 https://github.com/siyuan-note/siyuan/issues/6722

This commit is contained in:
Liang Ding 2022-11-28 11:54:04 +08:00
parent c20e936303
commit bc17efcaad
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 93 additions and 32 deletions

View file

@ -38,12 +38,17 @@ func findReplace(c *gin.Context) {
k := arg["k"].(string)
r := arg["r"].(string)
methodArg := arg["method"]
var method int // 0文本1查询语法2SQL3正则表达式
if nil != methodArg {
method = int(methodArg.(float64))
}
idsArg := arg["ids"].([]interface{})
var ids []string
for _, id := range idsArg {
ids = append(ids, id.(string))
}
err := model.FindReplace(k, r, ids)
err := model.FindReplace(k, r, ids, method)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()