mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Fix nth-of-type() not accepting identifier-based arguments
Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/2284#issuecomment-1271552479
This commit is contained in:
parent
93953f9b21
commit
3f8e3fe0c6
@ -1613,6 +1613,7 @@ Parser.prototype.SelectorCompiler = class {
|
|||||||
out.push(`#${data.name}`);
|
out.push(`#${data.name}`);
|
||||||
break;
|
break;
|
||||||
case 'Nth': {
|
case 'Nth': {
|
||||||
|
if ( data.nth.type === 'AnPlusB' ) {
|
||||||
const a = parseInt(data.nth.a, 10) || null;
|
const a = parseInt(data.nth.a, 10) || null;
|
||||||
const b = parseInt(data.nth.b, 10) || null;
|
const b = parseInt(data.nth.b, 10) || null;
|
||||||
if ( a !== null ) {
|
if ( a !== null ) {
|
||||||
@ -1626,6 +1627,9 @@ Parser.prototype.SelectorCompiler = class {
|
|||||||
} else if ( b !== null ) {
|
} else if ( b !== null ) {
|
||||||
out.push(`${b}`);
|
out.push(`${b}`);
|
||||||
}
|
}
|
||||||
|
} else if ( data.nth.type === 'Identifier' ) {
|
||||||
|
out.push(data.nth.name);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'PseudoClassSelector':
|
case 'PseudoClassSelector':
|
||||||
|
Loading…
Reference in New Issue
Block a user