fix match escaping for + and /, refs #726
This commit is contained in:
1 parent
e86878b0f3
commit
608ac25b7b
2 files changed
+21
-11
No files matched your search
@@ -73,7 +73,7 @@ const parseToken = function (w, opts) {
|
||||
}
|
||||
}
|
||||
//back-flags
|
||||
if (end(w) === '+') {
|
||||
if (end(w) === '+' && !w.endsWith('\\+')) {
|
||||
obj.greedy = true
|
||||
w = stripEnd(w)
|
||||
}
|
||||
@@ -98,7 +98,7 @@ const parseToken = function (w, opts) {
|
||||
}
|
||||
|
||||
//regex
|
||||
if (start(w) === '/' && end(w) === '/') {
|
||||
if (start(w) === '/' && end(w) === '/' && w.length > 2) {
|
||||
w = stripBoth(w)
|
||||
if (opts.caseSensitive) {
|
||||
obj.use = 'text'
|
||||
@@ -221,6 +221,8 @@ const parseToken = function (w, opts) {
|
||||
//somehow handle encoded-chars?
|
||||
w = w.replace('\\*', '*')
|
||||
w = w.replace('\\.', '.')
|
||||
w = w.replace('\\+', '+')
|
||||
w = w.replace('\\/', '/')
|
||||
if (opts.caseSensitive) {
|
||||
obj.use = 'text'
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user