Release Notes v0.9.0 (November 9, 2024)
This release includes significant improvements to node selection and manipulation methods, new functionality for content prepending, and a critical bug fix
🔄 Changes
- Added reverse iteration support in
Tree::child_ids_of_it
andNodeRef::children_it
(userev: true
for reverse order) - Improved internal logic for selection operations (
Selection::append_selection
andSelection::replace_with_selection
)
✨ New Features
- Added new node prepending methods:
NodeRef::prepend_child
: Insert a single child at the startNodeRef::prepend_children
: Insert multiple children at the startNodeRef::prepend_html
: Parse and insert HTML content at the startSelection::prepend_html
: Parse and insert HTML at the start of all matched nodes
- Introduced new selection extension methods:
Selection::ancestors
: Get ancestors of matched elementsSelection::add_selection
: Add another selection to current selectionSelection::add_matcher
Selection::add
Selection::try_add
🐛 Bug Fixes
- Enhanced selection operations to properly handle multiple nodes and cross-tree selections:
- Fixed
Selection::append_selection
- Fixed
Selection::replace_with_selection
- Fixed
- Improved node attachment methods to automatically handle node detachment from previous parent:
Node::append_child
Node::append_children
Node::prepend_child
Node::prepend_children
⚠️ Critical Fix
Fixed a significant issue in NodeRef::first_element_child
where the method incorrectly checked the node itself instead of its children. This fix may affect existing code that relies on this method.
Impact:
- CSS selector
:has()
behavior could have been affected - First element child detection logic
- Code depending on this method's behavior
Action Required:
Please review any code that depends on NodeRef::first_element_child
after upgrading to ensure compatibility with the corrected behavior.
Full Changelog: 0.8.0...0.9.0