mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 11:00:52 +08:00
🐛 查找替换中使用正则表达式后替换不正确 https://github.com/siyuan-note/siyuan/issues/6722
This commit is contained in:
parent
bc17efcaad
commit
b6188c642e
@ -98,7 +98,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
|
|||||||
<svg><use xlink:href="#iconEdit"></use></svg>
|
<svg><use xlink:href="#iconEdit"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<span id="searchSyntaxCheck" aria-label="${window.siyuan.languages.searchMethod}: ${methodText}" class="block__icon b3-tooltips b3-tooltips__w">
|
<span id="searchSyntaxCheck" aria-label="${window.siyuan.languages.searchMethod} ${methodText}" class="block__icon b3-tooltips b3-tooltips__w">
|
||||||
<svg><use xlink:href="#iconRegex"></use></svg>
|
<svg><use xlink:href="#iconRegex"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
@ -530,7 +530,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) =>
|
|||||||
current: config.method === 0,
|
current: config.method === 0,
|
||||||
click() {
|
click() {
|
||||||
config.method = 0;
|
config.method = 0;
|
||||||
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.text}`);
|
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.text}`);
|
||||||
inputEvent(element, config, undefined, edit);
|
inputEvent(element, config, undefined, edit);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
@ -539,7 +539,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) =>
|
|||||||
current: config.method === 1,
|
current: config.method === 1,
|
||||||
click() {
|
click() {
|
||||||
config.method = 1;
|
config.method = 1;
|
||||||
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.querySyntax}`);
|
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.querySyntax}`);
|
||||||
inputEvent(element, config, undefined, edit);
|
inputEvent(element, config, undefined, edit);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
@ -548,7 +548,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) =>
|
|||||||
current: config.method === 2,
|
current: config.method === 2,
|
||||||
click() {
|
click() {
|
||||||
config.method = 2;
|
config.method = 2;
|
||||||
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: SQL`);
|
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} SQL`);
|
||||||
inputEvent(element, config, undefined, edit);
|
inputEvent(element, config, undefined, edit);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
@ -557,7 +557,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) =>
|
|||||||
current: config.method === 3,
|
current: config.method === 3,
|
||||||
click() {
|
click() {
|
||||||
config.method = 3;
|
config.method = 3;
|
||||||
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.regex}`);
|
searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.regex}`);
|
||||||
inputEvent(element, config, undefined, edit);
|
inputEvent(element, config, undefined, edit);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
@ -52,7 +52,7 @@ func findReplace(c *gin.Context) {
|
|||||||
if nil != err {
|
if nil != err {
|
||||||
ret.Code = -1
|
ret.Code = -1
|
||||||
ret.Msg = err.Error()
|
ret.Msg = err.Error()
|
||||||
ret.Data = map[string]interface{}{"closeTimeout": 3000}
|
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -18,6 +18,7 @@ package model
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -169,7 +170,7 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, ne
|
|||||||
func FindReplace(keyword, replacement string, ids []string, method int) (err error) {
|
func FindReplace(keyword, replacement string, ids []string, method int) (err error) {
|
||||||
// method:0:文本,1:查询语法,2:SQL,3:正则表达式
|
// method:0:文本,1:查询语法,2:SQL,3:正则表达式
|
||||||
if 1 == method || 2 == method {
|
if 1 == method || 2 == method {
|
||||||
util.PushMsg(Conf.Language(132), 5000)
|
err = errors.New(Conf.Language(132))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user