Fix normalization of `matches-path` operator

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1690
This commit is contained in:
Raymond Hill 2021-08-21 10:20:43 -04:00
parent b2a792bae1
commit c0c70e2987
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 2 deletions

View File

@ -1588,6 +1588,7 @@ Parser.prototype.SelectorCompiler = class {
raw.push(`:has(${this.decompileProcedural(task[1])})`);
break;
case ':has-text':
case ':matches-path':
if ( Array.isArray(task[1]) ) {
value = `/${task[1][0]}/${task[1][1]}`;
} else {
@ -1596,7 +1597,7 @@ Parser.prototype.SelectorCompiler = class {
value = `/${task[1]}/`;
}
}
raw.push(`:has-text(${value})`);
raw.push(`${task[0]}(${value})`);
break;
case ':matches-css':
case ':matches-css-after':
@ -1618,7 +1619,6 @@ Parser.prototype.SelectorCompiler = class {
case ':spath':
raw.push(task[1]);
break;
case ':matches-path':
case ':min-text-length':
case ':upward':
case ':watch-attr':