You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.
Type a tag name containing "**" or other characters that constitute an invalid regexp
This will produce a JS error like below:
SyntaxError: Invalid regular expression: /a**b/: Nothing to repeat
at new RegExp (native)
at o (http://cdnjs.cloudflare.com/ajax/libs/ng-tags-input/2.0.0/ng-tags-input.min.js:1:5988)
at Scope.b.highlight (http://cdnjs.cloudflare.com/ajax/libs/ng-tags-input/2.0.0/ng-tags-input.min.js:1:6233)
at http://code.angularjs.org/1.2.15/angular.js:10348:21
at Object.getStringValue (http://code.angularjs.org/1.2.15/angular.js:17668:41)
at Scope.$digest (http://code.angularjs.org/1.2.15/angular.js:12023:40)
at Scope.$apply (http://code.angularjs.org/1.2.15/angular.js:12279:24)
at done (http://code.angularjs.org/1.2.15/angular.js:7991:45)
at completeRequest (http://code.angularjs.org/1.2.15/angular.js:8196:7)
at XMLHttpRequest.xhr.onreadystatechange (http://code.angularjs.org/1.2.15/angular.js:8137:11)
This is due to the code below in the autoComplete directive - user-generated text should be escaped before being passed to RegExp.
if (scope.options.highlightMatchedText) {
markdown = function(item, text) {
var expression = new RegExp(text, 'gi');
return item.replace(expression, '**$&**');
};
}
The text was updated successfully, but these errors were encountered:
Steps
This will produce a JS error like below:
This is due to the code below in the autoComplete directive - user-generated text should be escaped before being passed to RegExp.
The text was updated successfully, but these errors were encountered: