do not highlight when filter is "*"

This commit is contained in:
gorhill 2014-10-11 09:12:49 -04:00
parent fd9bc995f9
commit c2b6ad1fad
1 changed files with 11 additions and 7 deletions

View File

@ -79,13 +79,17 @@ var renderURL = function(url, filter) {
if ( reText.slice(0, 2) === '@@' ) {
reText = reText.slice(2);
}
reText = reText
.replace(/\./g, '\\.')
.replace(/\?/g, '\\?')
.replace('||', '')
.replace(/\^/g, '.')
.replace(/\*/g, '.*')
;
if ( reText === '*' ) {
reText = '\\*';
} else {
reText = reText
.replace(/\./g, '\\.')
.replace(/\?/g, '\\?')
.replace('||', '')
.replace(/\^/g, '.')
.replace(/\*/g, '.*')
;
}
var re = new RegExp(reText, 'gi');
var matches = re.exec(url);
var renderedURL = chunkify(url);