Skip to content

0.9.0

Latest
Compare
Choose a tag to compare
@niklak niklak released this 09 Nov 18:01
· 16 commits to main since this release

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 and NodeRef::children_it (use rev: true for reverse order)
  • Improved internal logic for selection operations (Selection::append_selection and Selection::replace_with_selection)

✨ New Features

  • Added new node prepending methods:
    • NodeRef::prepend_child: Insert a single child at the start
    • NodeRef::prepend_children: Insert multiple children at the start
    • NodeRef::prepend_html: Parse and insert HTML content at the start
    • Selection::prepend_html: Parse and insert HTML at the start of all matched nodes
  • Introduced new selection extension methods:
    • Selection::ancestors: Get ancestors of matched elements
    • Selection::add_selection: Add another selection to current selection
    • Selection::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
  • 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.

Changelog

Full Changelog: 0.8.0...0.9.0