[Finishes #52731407] Escape special regex characters from the spec param
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
jasmineRequire.HtmlSpecFilter = function() {
|
||||
function HtmlSpecFilter(options) {
|
||||
var filterPattern = new RegExp(options && options.filterString());
|
||||
var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
||||
var filterPattern = new RegExp(filterString);
|
||||
|
||||
this.matches = function(specName) {
|
||||
return filterPattern.test(specName);
|
||||
@@ -8,4 +9,4 @@ jasmineRequire.HtmlSpecFilter = function() {
|
||||
}
|
||||
|
||||
return HtmlSpecFilter;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user