Skip to content

Commit

Permalink
Fix normalization of matches-path operator
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Aug 21, 2021
1 parent b2a792b commit c0c70e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/static-filtering-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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':
Expand All @@ -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':
Expand Down

0 comments on commit c0c70e2

Please sign in to comment.