diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 9993acb6b..18b15fa42 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -2239,7 +2239,10 @@ export class AstFilterParser { const regex = before.startsWith('[$domain=/') ? `${before.slice(9, -1)}` : before; - const source = this.normalizeRegexPattern(regex); + // TODO: Remove unescaping of `|` once AdGuard filters no longer unduly + // escape. In the mean time, if a literal `|` is needed in a path-based + // regex, the solution is to use `\x7C` instead of `|`. + const source = this.normalizeRegexPattern(regex.replace(/\\\|/g, '|')); if ( source === '' ) { return ''; } const after = `/${source}/`; if ( after === before ) { return; }