Repository navigation
dom_query 0.29.0 (2026-10-23)
New Features
- Added the
checked-node-mutationsfeature for additional protection against invalid ancestor moves inNodeRefmutation methods. - Added
NodeIdProver::treeto identify the tree that owns a node ID. - Added
Tree::lento 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
StrTendriltoString, with no public API changes. - Reduced DOM memory usage by about 30% by storing
NodeIdas aNonZeroU32, halving the size ofTreeNodeand reducingNodeDatasize -- 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::validateto detect inconsistent parent-child relationships. - Fixed
NodeRef::normalizeandNodeRef::strip_elementsto 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
- @RomanAverin made their first contribution in #193
- @emschwartz made their first contribution in #224
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.
Full Changelog: 0.28.0...0.29.0