Skip to content

0.7.0

Compare
Choose a tag to compare
@niklak niklak released this 27 Oct 11:14
· 197 commits to main since this release

Release Notes v0.7.0 (October 27, 2024)

🚀 New Features

Node Tree API

  • Added Node::ancestors method to get all or limited number of node ancestors
  • New methods for working with related elements:
    • Node::element_children: returns child nodes of NodeData::Element type
    • Node::children_it: provides an iterator over child nodes
    • Node::ancestors_it: provides an iterator over ancestor nodes
  • Added Node::immediate_text method to get node's text without descendants
    • Similarly, Selection::immediate_text does the same for every node in selection

Tree API Extensions

  • New methods for working with node IDs:
    • Tree:child_ids_of and Tree:child_ids_of_it: get child node IDs as vec and as iterator respectively
    • Tree:ancestor_ids_of and Tree:ancestor_ids_of_it: get ancestor node IDs as vec and as iterator respectively

Selector Improvements

  • Enabled support for :is() and :where() pseudo-classes
  • Implemented :has support from the selectors crate
  • Added From<Vec<Node>> implementation for Selection

🔄 Changes

Performance Optimizations

  • Improved performance for several core operations:
    • Document::from
    • Selection::select
    • Other related methods
  • Switched from rustc-hash to foldhash

API Changes

  • Exposed Matcher::match_element for use outside the crate
  • Updated selectors::Element implementation for Node<'a>::opaque
  • Removed &mut requirement from Selection methods

Dependencies

  • Updated to selectors v0.26.0

Changelog

Full Changelog: 0.6.0...0.7.0