Skip to content

dom_query 0.29.0 (2026-10-23)

Choose a tag to compare

@niklak niklak released this 23 Oct 15:13
· 107 commits to main since this release

New Features

  • Added the checked-node-mutations feature for additional protection against invalid ancestor moves in NodeRef mutation methods.
  • Added NodeIdProver::tree to identify the tree that owns a node ID.
  • Added Tree::len to report the total number of nodes, including detached nodes.
  • Added CommonMark and GFM spec roundtrip tests for Markdown serialization.

Changes

  • Markdown: Improved serialization correctness across lists, tables, code blocks, links, images, inline formatting, and whitespace handling. Fixed numerous edge cases involving nested structures, escaping, and Markdown syntax — thanks to @emschwartz.
  • Markdown: Improved serialization performance by switching from StrTendril to String, with no public API changes.
  • Reduced DOM memory usage by about 30% by storing NodeId as a NonZeroU32, halving the size of TreeNode and reducing NodeData size -- thanks to @emschwartz.
  • Optimized AncestorNodes, NodeRef::formatted_text, and selector matching for better performance (@emschwartz).
  • Updated dependencies, switched to Rust edition 2024, and raised the MSRV to 1.85.

Bug Fixes

  • Fixed DOM mutation methods that could corrupt the tree when given nodes from another document.
  • Fixed invalid self-moves and, with checked-node-mutations, ancestor moves that could corrupt the tree.
  • Fixed multiple DOM mutation issues involving child reparenting, sibling ordering, node unwrapping, and moving children between nodes.
  • Fixed HTML fragment insertion and replacement to preserve parser-reparented content and correctly handle table contexts.
  • Fixed Tree::validate to detect inconsistent parent-child relationships.
  • Fixed NodeRef::normalize and NodeRef::strip_elements to handle deeply nested documents without stack overflow; also improved their performance.
  • Fixed copying template elements, ensuring their contents are preserved in selections and fragments.
  • Preserved element namespaces when renaming elements - thanks to @RomanAverin.

New Contributors

Special thanks to @emschwartz for the enthusiasm and substantial contributions to this release, particularly the significant improvements to Markdown serialization and the reduced memory footprint of the dom_query tree.


Examples

Changelog

Full Changelog: 0.28.0...0.29.0