Socket
Socket
Sign inDemoInstall

postcss-selector-parser

Package Overview
Dependencies
3
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous12356Next

3.0.0

Diff

Changelog

Source

3.0.0

Breaking changes

  • Some tweaks to the tokenizer/attribute selector parsing mean that whitespace locations might be slightly different to the 2.x code.
  • Better attribute selector parsing with more validation; postcss-selector-parser no longer uses regular expressions to parse attribute selectors.
  • Added an async API (thanks to @jacobp100); the default process API is now async, and the sync API is now accessed through processSync instead.
  • process() and processSync() now return a string instead of the Processor instance.
  • Tweaks handling of Less interpolation (thanks to @jwilsson).
  • Removes support for Node 0.12.

Other changes

  • ast() and astSync() methods have been added to the Processor. These return the Root node of the selectors after processing them.
  • transform() and transformSync() methods have been added to the Processor. These return the value returned by the processor callback after processing the selectors.
  • Set the parent when inserting a node (thanks to @chriseppstein).
  • Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac).
  • Fixes handling of namespaces with qualified tag selectors.
  • process, ast and transform (and their sync variants) now accept a postcss rule node. When provided, better errors are generated and selector processing is automatically set back to the rule selector (unless the updateSelector option is set to false.)
  • Now more memory efficient when tokenizing selectors.

Upgrade hints

The pattern of:

rule.selector = processor.process(rule.selector).result.toString();

is now:

processor.processSync(rule)

beneb
published 3.0.0-rc.0 •

beneb
published 2.2.3 •

Changelog

Source

2.2.3

  • Resolves an issue where the parser would not reduce multiple spaces between an ampersand and another simple selector in lossy mode (thanks to @adam-26).
beneb
published 2.2.2 •

Changelog

Source

2.2.2

  • No longer hangs on an unescaped semicolon; instead the parser will throw an exception for these cases.
beneb
published 2.2.1 •

Changelog

Source

2.2.1

  • Allows a consumer to specify whitespace tokens when creating a new Node (thanks to @Semigradsky).
beneb
published 2.2.0 •

Changelog

Source

2.2.0

  • Added a new option to normalize whitespace when parsing the selector string (thanks to @adam-26).
beneb
published 2.1.1 •

Changelog

Source

2.1.1

  • Better unquoted value handling within attribute selectors (thanks to @evilebottnawi).
beneb
published 2.1.0 •

Changelog

Source

2.1.0

  • Added: Use string constants for all node types & expose them on the main parser instance (thanks to @Aweary).
beneb
published 2.0.0 •

Changelog

Source

2.0.0

This release contains the following breaking changes:

  • Renamed all eachInside iterators to walk. For example, eachTag is now walkTags, and eachInside is now walk.
  • Renamed Node#removeSelf() to Node#remove().
  • Renamed Container#remove() to Container#removeChild().
  • Renamed Node#raw to Node#raws (thanks to @davidtheclark).
  • Now parses & as the nesting selector, rather than a tag selector.
  • Fixes misinterpretation of Sass interpolation (e.g. #{foo}) as an id selector (thanks to @davidtheclark).

and;

  • Fixes parsing of attribute selectors with equals signs in them (e.g. [data-attr="foo=bar"]) (thanks to @montmanu).
  • Adds quoted and raw.unquoted properties to attribute nodes (thanks to @davidtheclark).
beneb
published 1.3.3 •

Changelog

Source

1.3.3

  • Fixes an infinite loop on ) and ] tokens when they had no opening pairs. Now postcss-selector-parser will throw when it encounters these lone tokens.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc