Skip to content

0.8.0

Compare
Choose a tag to compare
@niklak niklak released this 03 Nov 15:35
· 149 commits to main since this release

Release Notes v0.8.0 (November 3, 2024)

This release brings significant internal refactoring, new filtering capabilities, and improvements to node manipulation methods.

📚 Check out examples

🔄 Major Changes

  • Simplified internal architecture by replacing generic types with concrete NodeData type
  • Moved implementations from Node to NodeRef (Node is now an alias for NodeRef)
  • Simplified the internal logic of several methods (replace_with_html, set_html, append_html) using Tree::merge

✨ New Features

  • Added new Selection filtering methods:
    • Selection::filter
    • Selection::filter_matcher
    • Selection::try_filter
    • Selection::filter_selection
  • Introduced new NodeRef manipulation methods:
    • NodeRef::replace_with - replace a node with another one
    • NodeRef::replace_with_html - replace a node with HTML content
    • NodeRef::set_text - set node's text content
    • NodeRef::append_prev_siblings - prepend nodes before selected node
  • Added new :only-text pseudo-class for selecting nodes with single text child
  • Implemented NodeIdProver trait for NodeRef and Node to simplify API usage

🛠️ Minor Changes

  • Simplified Node::has_text functionality

🐛 Bug Fixes

  • Corrected <NodeRef<'a> as selectors::Element>::is_empty to handle line breaks and whitespace properly.

🗑️ Removals

The following deprecated methods have been removed:

  • Tree::append_children_from_another_tree
  • Tree::append_prev_siblings_from_another_tree
  • Node::append_children_from_another_tree
  • Node::append_prev_siblings_from_another_tree

Changelog

Full Changelog: 0.7.0...0.8.0