3 * SECURITY FIX: update `dot-prop` to `5.2.0`
7 * Unfortunately, due to fixing the vulnerability, the minimum supported version of the Node.js is `8`.
11 * Fix: typescript definitions weren't in the published package.
15 * Fixed numerous bugs in attribute nodes relating to the handling of comments
16 and whitespace. There's significant changes to `attrNode.spaces` and `attrNode.raws` since the `3.0.0` release.
17 * Added `Attribute#offsetOf(part)` to get the offset location of
18 attribute parts like `"operator"` and `"value"`. This is most
19 often added to `Attribute#sourceIndex` for error reporting.
25 * Some tweaks to the tokenizer/attribute selector parsing mean that whitespace
26 locations might be slightly different to the 2.x code.
27 * Better attribute selector parsing with more validation; postcss-selector-parser
28 no longer uses regular expressions to parse attribute selectors.
29 * Added an async API (thanks to @jacobp100); the default `process` API is now
30 async, and the sync API is now accessed through `processSync` instead.
31 * `process()` and `processSync()` now return a string instead of the Processor
33 * Tweaks handling of Less interpolation (thanks to @jwilsson).
34 * Removes support for Node 0.12.
38 * `ast()` and `astSync()` methods have been added to the `Processor`. These
39 return the `Root` node of the selectors after processing them.
40 * `transform()` and `transformSync()` methods have been added to the
41 `Processor`. These return the value returned by the processor callback
42 after processing the selectors.
43 * Set the parent when inserting a node (thanks to @chriseppstein).
44 * Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac).
45 * Fixes handling of namespaces with qualified tag selectors.
46 * `process`, `ast` and `transform` (and their sync variants) now accept a
47 `postcss` rule node. When provided, better errors are generated and selector
48 processing is automatically set back to the rule selector (unless the `updateSelector` option is set to `false`.)
49 * Now more memory efficient when tokenizing selectors.
55 `rule.selector = processor.process(rule.selector).result.toString();`
59 `processor.processSync(rule)`
63 * Resolves an issue where the parser would not reduce multiple spaces between an
64 ampersand and another simple selector in lossy mode (thanks to @adam-26).
68 * No longer hangs on an unescaped semicolon; instead the parser will throw
69 an exception for these cases.
73 * Allows a consumer to specify whitespace tokens when creating a new Node
74 (thanks to @Semigradsky).
78 * Added a new option to normalize whitespace when parsing the selector string
83 * Better unquoted value handling within attribute selectors
84 (thanks to @evilebottnawi).
88 * Added: Use string constants for all node types & expose them on the main
89 parser instance (thanks to @Aweary).
93 This release contains the following breaking changes:
95 * Renamed all `eachInside` iterators to `walk`. For example, `eachTag` is now
96 `walkTags`, and `eachInside` is now `walk`.
97 * Renamed `Node#removeSelf()` to `Node#remove()`.
98 * Renamed `Container#remove()` to `Container#removeChild()`.
99 * Renamed `Node#raw` to `Node#raws` (thanks to @davidtheclark).
100 * Now parses `&` as the *nesting* selector, rather than a *tag* selector.
101 * Fixes misinterpretation of Sass interpolation (e.g. `#{foo}`) as an
102 id selector (thanks to @davidtheclark).
106 * Fixes parsing of attribute selectors with equals signs in them
107 (e.g. `[data-attr="foo=bar"]`) (thanks to @montmanu).
108 * Adds `quoted` and `raw.unquoted` properties to attribute nodes
109 (thanks to @davidtheclark).
113 * Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs.
114 Now postcss-selector-parser will throw when it encounters these lone tokens.
118 * Now uses plain integers rather than `str.charCodeAt(0)` for compiled builds.
122 * Update flatten to v1.x (thanks to @shinnn).
126 * Adds a new node type, `String`, to fix a crash on selectors such as
131 * Fixes a crash when the parser encountered a trailing combinator.
135 * A more descriptive error is thrown when the parser expects to find a
136 pseudo-class/pseudo-element (thanks to @ashelley).
137 * Adds support for line/column locations for selector nodes, as well as a
138 `Node#sourceIndex` method (thanks to @davidtheclark).
142 * Fixes a crash when a selector started with a `>` combinator. The module will
143 now no longer throw if a selector has a leading/trailing combinator node.
147 * Fixes a crash on `@` tokens.
151 * Fixes an infinite loop caused by using parentheses in a non-pseudo element
156 * Fixes a crash when a backslash ended a selector string.
160 * Adds support for replacing multiple nodes at once with `replaceWith`
161 (thanks to @jonathantneal).
162 * Parser no longer throws on sequential IDs and trailing commas, to support
163 parsing of selector hacks.
167 * Fixes using `insertAfter` and `insertBefore` during iteration.
171 * Adds `clone` and `replaceWith` methods to nodes.
172 * Adds `insertBefore` and `insertAfter` to containers.
177 * Fixes crash on extra whitespace inside a pseudo selector's parentheses.
178 * Adds sort function to the container class.
179 * Enables the parser to pass its input through without transforming.
180 * Iteration-safe `each` and `eachInside`.
184 * Tidy up redundant duplication.
185 * Fixes a bug where the parser would loop infinitely on universal selectors
186 inside pseudo selectors.
187 * Adds `length` getter and `eachInside`, `map`, `reduce` to the container class.
188 * When a selector has been removed from the tree, the root node will no longer
190 * Adds node type iterators to the container class (e.g. `eachComment`).
191 * Adds filter function to the container class.
192 * Adds split function to the container class.
193 * Create new node types by doing `parser.id(opts)` etc.
194 * Adds support for pseudo classes anywhere in the selector.
198 * Adds `next` and `prev` to the node class.
199 * Adds `first` and `last` getters to the container class.
200 * Adds `every` and `some` iterators to the container class.
201 * Add `empty` alias for `removeAll`.
202 * Combinators are now types of node.
203 * Fixes the at method so that it is not an alias for `index`.
204 * Tidy up creation of new nodes in the parser.
205 * Refactors how namespaces are handled for consistency & less redundant code.
206 * Refactors AST to use `nodes` exclusively, and eliminates excessive nesting.
207 * Fixes nested pseudo parsing.
208 * Fixes whitespace parsing.
212 * Adds support for namespace selectors.
213 * Adds support for selectors joined by escaped spaces - such as `.\31\ 0`.