- fix minor issue in
package.jsonrelated to types. Unlikely to affect modern usage.
- targeting Node 20;
- added simple pseudo-classes support - any pseudo-class with no arguments is now supported;
- added three functional pseudo-classes support:
:is(),:where(),:not(); normalize()now accepts an options object (NormalizeOptions);mode: 'html' | 'xml'controls case-folding for element (tag) names, attribute names, and namespace prefixes (HTML mode lowercases; XML mode preserves case);attributesWithNormalizedValuesenables canonicalization of attribute values:- it is left to the user to provide attribute names for which values are to be treated as case-insensitive by default
- Note: in some cases, attribute name might not be sufficient to determine case-sensitivity of its value. For now, this is chosen as good enough for the purposes of this library;
- if an attribute selector has modifier
i, its value is lowercased; - if modifier is omitted (
null), the value is lowercased only for configured attribute names;
- it is left to the user to provide attribute names for which values are to be treated as case-insensitive by default
- by default, missing modifiers are made explicit (
iors) for stable, comparable output; this can be disabled withallowUnspecifiedCaseSensitivityForAttributes.
Possibly breaking changes:
normalize()output might differ for some selectors;parse()now supports more selectors - will return an AST instead of throwing an error for them.
- runtime check for input of
parseandparse1to be a string.
-
support for escape sequences according to specifications (#97).
Now follows https://www.w3.org/TR/selectors-3/#lex for parsing and https://w3c.github.io/csswg-drafts/cssom/#common-serializing-idioms for serializing.
Possibly breaking changes:
- parsed strings (attribute values) retained escape sequences previously, now they are unescaped;
- strings with
"character were serialized as single-quoted previously, now all strings serialized as double-quoted, per spec suggestion.
- targeting Node.js version 14 and ES2020;
- now should be discoverable with denoify.
- bump dependencies - fix "./core module cannot be found" issue.
- fix namespace parsing;
- remove terser, use only
rollup-plugin-cleanupto condition published files.
- replaced
mooandnearleywith my leac and peberminta packages. Nowparseleywith all dependencies are TypeScript, dual CommonJS/ES module packages; - package is marked as free of side effects and tersed;
- Deno version is provided, with the help of
denoify.
- drop Node.js version 10 support. 12.22.x is required;
- fix typos in type definitions.
- switched to TypeScript;
- added type definitions for AST;
- hybrid package (ESM, CommonJS);
- renamed
sort()tonormalize()in order to better reflect what it does; - replaced
compareArrays()withcompareSpecificity()andcompareSelectors()- more sensible API; - generated documentation.
- added
sort()andcompareArrays()functions.
Initial release.
Aiming at Node.js version 10 and up.