0.8.0
Release Notes v0.8.0 (November 3, 2024)
This release brings significant internal refactoring, new filtering capabilities, and improvements to node manipulation methods.
🔄 Major Changes
- Simplified internal architecture by replacing generic types with concrete
NodeData
type - Moved implementations from
Node
toNodeRef
(Node
is now an alias forNodeRef
) - Simplified the internal logic of several methods (
replace_with_html
,set_html
,append_html
) usingTree::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 oneNodeRef::replace_with_html
- replace a node with HTML contentNodeRef::set_text
- set node's text contentNodeRef::append_prev_siblings
- prepend nodes before selected node
- Added new
:only-text
pseudo-class for selecting nodes with single text child - Implemented
NodeIdProver
trait forNodeRef
andNode
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
Full Changelog: 0.7.0...0.8.0