mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 17:17:57 +01:00
this further fix #997: no need to use /
for leading *
This commit is contained in:
parent
8553411cfa
commit
94e4a95f9b
1 changed files with 3 additions and 1 deletions
|
@ -1622,8 +1622,10 @@ FilterParser.prototype.parse = function(raw) {
|
|||
// TODO: transforming `^` into `*` is not a strict interpretation of
|
||||
// ABP syntax.
|
||||
if ( this.reHasWildcard.test(s) ) {
|
||||
s = s.replace(/^\*+([^%0-9a-z])/, '$1') // remove pointless leading *
|
||||
.replace(/([^%0-9a-z])\*+$/, '$1'); // remove pointless trailing *
|
||||
s = trimChar(s, '^');
|
||||
s = s.replace(/\^/g, '*').replace(/\*\*+/g, '*');
|
||||
s = trimChar(s, '*');
|
||||
}
|
||||
|
||||
// nothing left?
|
||||
|
|
Loading…
Reference in a new issue