1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-06 19:02:30 +01:00

Fix incorrect serialization of pseudo elements

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/ylnvwf/how_to_block_suggestive_keyword_in_reddit_search/iv014wu/
This commit is contained in:
Raymond Hill 2022-11-04 10:55:10 -04:00
parent d7cca916a6
commit c3d0d574d7
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1636,7 +1636,8 @@ Parser.prototype.SelectorCompiler = class {
}
case 'PseudoClassSelector':
case 'PseudoElementSelector':
out.push(`:${data.name}`);
out.push(data.type === 'PseudoClassSelector' ? ':' : '::');
out.push(data.name);
if ( Array.isArray(part.args) ) {
const arg = this.astSerialize(part.args);
if ( typeof arg !== 'string' ) { return; }
@ -1656,7 +1657,6 @@ Parser.prototype.SelectorCompiler = class {
return out.join('');
}
astSerialize(parts, plainCSS = true) {
const out = [];
for ( const part of parts ) {