1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00
This commit is contained in:
gorhill 2015-05-27 20:48:04 -04:00
parent d7c10005c8
commit 39fb395e2c

View File

@ -892,8 +892,8 @@ var rowFilterer = (function() {
var raw = uDom('#filterInput').val().trim();
var rawParts = raw.split(/\s+/);
var reStr, reStrs = [], not = false;
var i = rawParts.length;
while ( i-- ) {
var n = rawParts.length;
for ( var i = 0; i < n; i++ ) {
rawPart = rawParts[i];
if ( rawPart.charAt(0) === '!' ) {
if ( reStrs.length === 0 ) {
@ -901,10 +901,6 @@ var rowFilterer = (function() {
}
rawPart = rawPart.slice(1);
}
not = rawPart.charAt(0) === '!';
if ( not ) {
rawPart = rawPart.slice(1);
}
hardBeg = rawPart.charAt(0) === '|';
if ( hardBeg ) {
rawPart = rawPart.slice(1);
@ -925,7 +921,8 @@ var rowFilterer = (function() {
reStr += '(?:\\s|$)';
}
reStrs.push(reStr);
if ( i !== 0 && rawParts[i-1] === '||' ) {
if ( i < (n - 1) && rawParts[i + 1] === '||' ) {
i += 1;
continue;
}
reStr = reStrs.length === 1 ? reStrs[0] : reStrs.join('|');