Skip to content

Commit

Permalink
Merge pull request #130 from wtgtybhertgeghgtwtg/unescape
Browse files Browse the repository at this point in the history
Remove unnecessary escapes.
  • Loading branch information
jonschlinkert committed Dec 14, 2018
2 parents 677f127 + 7d45e19 commit f2ce9d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function(snapdragon) {
snapdragon.parser
.use(function() {
// override "notRegex" created in nanomatch parser
this.notRegex = /^\!+(?!\()/;
this.notRegex = /^!+(?!\()/;
})
// reset the referenced parsers
.capture('escape', escape)
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ utils.isObject = function(val) {
*/

utils.hasSpecialChars = function(str) {
return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str);
return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str);
};

/**
* Escape regex characters in the given string
*/

utils.escapeRegex = function(str) {
return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&');
return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&');
};

/**
Expand Down

0 comments on commit f2ce9d2

Please sign in to comment.