diff --git a/src/__fixtures__/tests.ts b/src/__fixtures__/tests.ts index d49454f5..ce019be6 100644 --- a/src/__fixtures__/tests.ts +++ b/src/__fixtures__/tests.ts @@ -456,4 +456,31 @@ export const tests: [string, Selector[][], string][] = [ ], "multiple selectors", ], + + [ + ':host(h1, p)', + [ + [ + { + type: "pseudo", + name: "host", + data: [ + [ + { + "type":"tag", + "name":"h1" + } + ], + [ + { + "type":"tag", + "name":"p" + } + ] + ] + }, + ], + ], + "pseudo selector with data", + ] ]; diff --git a/src/parse.ts b/src/parse.ts index bdde45df..5153e7bb 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -96,7 +96,7 @@ const attribSelectors: { [key: string]: [string, AttributeAction] } = { }; // Pseudos, whose data property is parsed as well. -const unpackPseudos = new Set(["has", "not", "matches", "is"]); +const unpackPseudos = new Set(["has", "not", "matches", "is", "host", "host-context"]); const stripQuotesFromPseudos = new Set(["contains", "icontains"]);