css-select

a CSS selector compiler & engine

BSD-2-CLAUSE License

Downloads
135.9M
Stars
548
Committers
27
css-select - Latest Release

Published by fb55 over 2 years ago

  • Added an option to disable relative selectors (#766) 1c1f7f2
    • By default, selectors are relative to the passed context, which means that no parent elements of the context will be matched. (Eg. a b c with context b will never give any results.)
      If the relativeSelector option is set to false, selectors won't be absolutized and selectors can test for parent elements outside of the context.
    • See https://github.com/fb55/css-select/issues/709 for context.

https://github.com/fb55/css-select/compare/v5.0.1...v5.1.0

css-select -

Published by fb55 over 2 years ago

  • fix: Previously, some options weren't properly passed on to sub-selectors such as :is(...) or :not(...). (#758) 77945c4

https://github.com/fb55/css-select/compare/v5.0.0...v5.0.1

css-select -

Published by fb55 over 2 years ago

Breaking

  • domhandler's node types have changed. Some of these changes were inherited by css-select #754
  • css-select is now a dual CJS and ESM package #756
    • Deep imports are no longer permitted
  • Throw an error for :host-context #755
    • The error message for unknown pseudo classes has changed.

Features

  • Added a pseudos option #757
    • This option allows users to specify pseudo-classes.
    • Extending filters, pseudos and aliases is now deprecated.

https://github.com/fb55/css-select/compare/v4.3.0...v5.0.0

css-select - v4.3.0

Published by fb55 over 2 years ago

What's Changed

  • feat: Upgrade to css-what@6, add quirks mode option by @fb55 in https://github.com/fb55/css-select/pull/657
    • In quirks mode, .class and #id selectors are case-insensitive.
  • feat: Add optional prevElementSibling adapter method by @fb55 in 78776e8
  • fix: Throw errors for namespaced selectors by @fb55 in 255e965
    • Namespaced selectors (eg. *|div, [foo|bar] already caused errors before this release. We now parse them properly and throw errors with better descriptions.

Full Changelog: https://github.com/fb55/css-select/compare/v4.2.1...v4.3.0

css-select -

Published by fb55 almost 3 years ago

  • fix: Don't add siblings multiple times in appendNextSiblings (#656) 726f51b
  • docs: Improve README e8974a3

https://github.com/fb55/css-select/compare/v4.2.0...v4.2.1

css-select - v4.2.0

Published by fb55 almost 3 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/fb55/css-select/compare/v4.1.3...v4.2.0

css-select -

Published by fb55 over 3 years ago

Fixes:

  • compile's return value type was updated to Node, instead of an Element (more types can now be passed). 1419455

Dependencies:

  • Bump css-what from 5.0.0 to 5.0.1, fixing potentially expensive regex (#451) e3f4cf1
  • Use @types/boolbase 636c238

https://github.com/fb55/css-select/compare/v4.1.2...v4.1.3

css-select -

Published by fb55 over 3 years ago

  • fix(types): Fixed last context types e15cc53

https://github.com/fb55/css-select/compare/v4.1.1...v4.1.2

css-select -

Published by fb55 over 3 years ago

  • fix(types): Fix context types not being updated everywhere d2b0409

https://github.com/fb55/css-select/compare/v4.1.0...v4.1.1

css-select -

Published by fb55 over 3 years ago

Added support for additional parameter types:

  • Allow plain nodes as context (#424) 58109d6
  • Allow parsed selectors to be passed directly to functions (#418) 01afada

https://github.com/fb55/css-select/compare/v4.0.0...v4.1.0

css-select -

Published by fb55 over 3 years ago

New features:

  • Aliases are a new way to write pseudos (#403) 206535e
    • It is now possible to write a pseudo selector that shortens a longer selector as an alias. Have a look at #403 for examples.
    • BREAKING: Several built-in pseudos are now stricter. This aligns them with the CSS spec, but might lead to changes in results.
  • Upgraded to [email protected]
    • Added support for the s flag in attribute selectors.
    • BREAKING: In HTML, attributes are now automatically considered case-insensitive, based on the HTML spec. Some selectors might now match more elements.

Fixes:

  • Fix != ignoring elements without attribute (#402) 4484259

Other:

  • BREAKING: Removed strict option 9329fb8
    • This option was out of date and needed a bigger refactor. Please open an issue if you were using it, and we can discuss a path forward.

https://github.com/fb55/css-select/compare/v3.1.2...v4.0.0

css-select -

Published by fb55 almost 4 years ago

  • fix: Ensure parent elements are tags efcfcdb
    • Now that parent elements can also be documents, this fixes some edge-cases.
  • bump domutils from 2.4.2 to 2.4.4 b141d76

https://github.com/fb55/css-select/compare/v3.1.1...v3.1.2

css-select -

Published by fb55 almost 4 years ago

Fixes:

  • Support DOM elements of type root in the :root pseudo-selector c4d2b7b

Dependency upgrades:

  • bump domutils, domhandler & htmlparser2 (#312) c4d2b7b
  • bump nth-check from 1.0.2 to 2.0.0 187c9cd
  • bump css-what from 3.4.1 to 4.0.0 4241106
css-select -

Published by fb55 about 4 years ago

  • feat(index): Export prepareContext function f997165
  • feat(general): Add cacheResults option 6db3de6
  • fix(general): Fix descendant cache issue 0c0a8ff
  • refactor(tests): Remove positional, fix attribute tests for Sizzle spec b8ae895

https://github.com/fb55/css-select/compare/v3.0.4...v3.1.0

css-select -

Published by fb55 about 4 years ago

  • Bump css-what, add domhandler as dep cbb7187
  • Run prettier in check mode before passing tests 8bd03e8
  • Update funding information 3242963

https://github.com/fb55/css-select/compare/v3.0.3...v3.0.4

css-select -

Published by fb55 about 4 years ago

  • Fix types entry in package.json
css-select -

Published by fb55 about 4 years ago

  • Fixed an issue where the previous release didn't include built assets (reported in #229)
  • Ported tests to Jest & TS
css-select -

Published by fb55 about 4 years ago

  • Port all shipped code to TypeScript, identifying several inconsistencies along the way
    • BREAKING: The module exports an object now, which includes a default property. If you used the exported function before, you will have to update your code.
  • Use adapter.equals across the codebase
    • BREAKING: The signature for pseudos has changed. The second argument is now the options object, not the adapter anymore. To update your code, extract the adapter from the options object, eg. pseudos.custom = (elem, adapter) => {} is now pseudos.custom = (elem, {adapter}) => {}.
  • Implement :any-link
  • Support traversal-first :has (fixes #111)
css-select -

Published by fb55 about 4 years ago

Released with a breaking bug, please ignore.

css-select -

Published by fb55 almost 5 years ago

  • Add pseudos that depend on optional Adapter APIs (#139, @jaspreet57)
  • fix: :scope not matching when selecting in a scope (#154, @eps1lon)
  • Bump css-what to 3.2.1