ast-merge v3.0.0 released!
3.0.0 - 2026-01-05
- TAG: v3.0.0
- COVERAGE: 96.93% – 2462/2540 lines in 47 files
- BRANCH COVERAGE: 89.62% – 794/886 branches in 47 files
- 98.72% documented
Added
TestableNodespec helper class that wraps a mock in a realTreeHaver::Node, providing consistent API testing without relying on fragile mocksRecipe::Preset#match_refineraccessor method (was missing, causing errors in Recipe::Runner)- Minimal reproduction specs for
to_commonmarknormalization behavior:spec/integration/link_reference_preservation_spec.rb- tests link ref preservationspec/integration/table_formatting_preservation_spec.rb- tests table padding preservation
Ast::Merge::PartialTemplateMergerBase- Abstract base class for parser-agnostic partial template merging#build_position_based_signature_generator- Creates signature generators that match elements by position- Position counters reset per document key, enabling tables at same position to match regardless of structure
Changed
- BREAKING:
NavigableStatement#textnow requires nodes to conform to TreeHaver Node API (must have#textmethod)- Removed conditional fallbacks for
to_plaintext,to_commonmark,slice - Nodes must now implement
#textdirectly (all TreeHaver backends already do)
- Removed conditional fallbacks for
- BREAKING:
ContentMatchRefiner#extract_contentnow requires nodes to conform to TreeHaver Node API- Removed conditional fallbacks for
text_content,string_content,content,to_s - Custom
content_extractorproc still supported for non-standard nodes
- Removed conditional fallbacks for
- Signature generators and typing scripts now receive TreeHaver nodes directly (no NavigableStatement wrapping)
- Removed NavigableStatement wrapping from
FileAnalyzable#generate_signatureandNodeTyping.process
Removed
- BREAKING:
Ast::Merge::PartialTemplateMergerremoved. UseMarkdown::Merge::PartialTemplateMergerdirectly.- The base class
Ast::Merge::PartialTemplateMergerBaseremains for other parsers to extend - Migration: change
Ast::Merge::PartialTemplateMerger.new(parser: :markly, ...)toMarkdown::Merge::PartialTemplateMerger.new(backend: :markly, ...)
- The base class
Fixed
- Source-based rendering:
Markdown::Merge::PartialTemplateMerger#node_to_textnow prefers extracting original source text usinganalysis.source_rangeinstead ofto_commonmark. This preserves:- Link reference definitions (no conversion to inline links)
- Table column padding/alignment
- Original formatting exactly as written
Many paths lead to being a sponsor or a backer of this project. Are you on such a path?