v3.1.0
3.1.0
Added
- Support for boolean expression multiplier in syntax definition, i.e. `<boolean-expr[ test ]>`
- Add `source`, `startOffset`, `startLine`, and `startColumn` parameters to `OffsetToLocation` constructor
- Expose `OffsetToLocation` class in the main entry point
Fixed
- Fix `Raw` node value consumption by ignoring stop tokens inside blocks
- Fix `TokenStream#balance` computation to handle unmatched brackets correctly
- Fix syntax definition parser to allow a token to be followed by a multiplier
- Fix location for `Layer` node
- Added support for boolean expression multiplier in syntax definition, i.e.
<boolean-expr[ test ]>(#304) - Added
source,startOffset,startLine, andstartColumnparameters toOffsetToLocationconstructor, eliminating the need to callsetSource()after creating a newOffsetToLocationinstance - Exposed
OffsetToLocationclass in the main entry point, which was previously accessible only viacss-tree/tokenizer - Fixed
Rawnode value consumption by ignoring stop tokens inside blocks, resolving an issue whereRawvalue consumption stopped prematurely. This fix also enables parsing of functions whose content includes stop characters (e.g., semicolons and curly braces) within declaration values, aligning with the latest draft of CSS Values and Units L5. - Fixed
TokenStream#balancecomputation to handle unmatched brackets correctly. Previously, when encountering a closing bracket, theTokenStreamwould prioritize it over unmatched opening brackets, leading to improper parsing. For example, the parser would incorrectly consume the declaration value of.a { prop: ([{); }as([{)instead of consuming it until all opened brackets were closed (([{); }). Now, unmatched closing brackets are discarded unless they match the most recent opening bracket on the stack. This change aligns CSSTree with CSS specifications and browser behavior. - Fixed syntax definition parser to allow a token to be followed by a multiplier (#303)
- Fixed location for
Layernode (#310) - Bumped
mdn/datato 2.12.2