diff --git a/CHANGELOG.md b/CHANGELOG.md index 054e5d7..434d80a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Fixed parsing unclosed attribute selector (such as `a[href`). +- Fixed parsing bare pseudo class or element selectors. ## v2.11.3 diff --git a/parser.d.ts b/parser.d.ts index 75c9bfe..502da01 100644 --- a/parser.d.ts +++ b/parser.d.ts @@ -34,6 +34,8 @@ type PseudoClassesFirstChar = type Split = S extends `${string},` // invalid selector ? unknown + : S extends '' + ? '' : SplitRec type SplitRec = S extends `${infer Left},${infer Right}` ? SplitRec diff --git a/parser.test.ts b/parser.test.ts index d5d660a..4f1e5ab 100644 --- a/parser.test.ts +++ b/parser.test.ts @@ -355,6 +355,8 @@ type _Tests = [ Element > >, + Expect, Element>>, + Expect, Element>>, ] declare function delegate<