markdown-merge 1.0.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/markdown/merge/version.rb +3 -4
- data/lib/markdown/merge.rb +538 -137
- data/lib/markdown-merge.rb +3 -4
- data.tar.gz.sig +0 -0
- metadata +28 -289
- metadata.gz.sig +0 -0
- data/CHANGELOG.md +0 -308
- data/CITATION.cff +0 -20
- data/CODE_OF_CONDUCT.md +0 -134
- data/CONTRIBUTING.md +0 -227
- data/FUNDING.md +0 -74
- data/LICENSE.txt +0 -21
- data/README.md +0 -1064
- data/REEK +0 -0
- data/RUBOCOP.md +0 -71
- data/SECURITY.md +0 -21
- data/lib/markdown/merge/cleanse/block_spacing.rb +0 -253
- data/lib/markdown/merge/cleanse/code_fence_spacing.rb +0 -294
- data/lib/markdown/merge/cleanse/condensed_link_refs.rb +0 -405
- data/lib/markdown/merge/cleanse.rb +0 -42
- data/lib/markdown/merge/code_block_merger.rb +0 -300
- data/lib/markdown/merge/conflict_resolver.rb +0 -128
- data/lib/markdown/merge/debug_logger.rb +0 -26
- data/lib/markdown/merge/document_problems.rb +0 -190
- data/lib/markdown/merge/file_aligner.rb +0 -196
- data/lib/markdown/merge/file_analysis.rb +0 -353
- data/lib/markdown/merge/file_analysis_base.rb +0 -629
- data/lib/markdown/merge/freeze_node.rb +0 -93
- data/lib/markdown/merge/gap_line_node.rb +0 -136
- data/lib/markdown/merge/link_definition_formatter.rb +0 -49
- data/lib/markdown/merge/link_definition_node.rb +0 -157
- data/lib/markdown/merge/link_parser.rb +0 -421
- data/lib/markdown/merge/link_reference_rehydrator.rb +0 -320
- data/lib/markdown/merge/markdown_structure.rb +0 -123
- data/lib/markdown/merge/merge_result.rb +0 -166
- data/lib/markdown/merge/node_type_normalizer.rb +0 -126
- data/lib/markdown/merge/output_builder.rb +0 -166
- data/lib/markdown/merge/partial_template_merger.rb +0 -334
- data/lib/markdown/merge/smart_merger.rb +0 -221
- data/lib/markdown/merge/smart_merger_base.rb +0 -621
- data/lib/markdown/merge/table_match_algorithm.rb +0 -504
- data/lib/markdown/merge/table_match_refiner.rb +0 -136
- data/lib/markdown/merge/whitespace_normalizer.rb +0 -251
- data/sig/markdown/merge.rbs +0 -341
data/CHANGELOG.md
DELETED
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
[![SemVer 2.0.0][📌semver-img]][📌semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog]
|
|
4
|
-
|
|
5
|
-
All notable changes to this project will be documented in this file.
|
|
6
|
-
|
|
7
|
-
The format is based on [Keep a Changelog][📗keep-changelog],
|
|
8
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|
9
|
-
and [yes][📌major-versions-not-sacred], platform and engine support are part of the [public API][📌semver-breaking].
|
|
10
|
-
Please file a bug if you notice a violation of semantic versioning.
|
|
11
|
-
|
|
12
|
-
[📌semver]: https://semver.org/spec/v2.0.0.html
|
|
13
|
-
[📌semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
|
|
14
|
-
[📌semver-breaking]: https://github.com/semver/semver/issues/716#issuecomment-869336139
|
|
15
|
-
[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
|
16
|
-
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
|
17
|
-
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
|
18
|
-
|
|
19
|
-
## [Unreleased]
|
|
20
|
-
|
|
21
|
-
### Added
|
|
22
|
-
|
|
23
|
-
### Changed
|
|
24
|
-
|
|
25
|
-
### Deprecated
|
|
26
|
-
|
|
27
|
-
### Removed
|
|
28
|
-
|
|
29
|
-
### Fixed
|
|
30
|
-
|
|
31
|
-
### Security
|
|
32
|
-
|
|
33
|
-
## [1.0.3] - 2026-02-19
|
|
34
|
-
|
|
35
|
-
- TAG: [v1.0.3][1.0.3t]
|
|
36
|
-
- COVERAGE: 93.12% -- 1611/1730 lines in 25 files
|
|
37
|
-
- BRANCH COVERAGE: 81.52% -- 525/644 branches in 25 files
|
|
38
|
-
- 96.92% documented
|
|
39
|
-
|
|
40
|
-
### Added
|
|
41
|
-
|
|
42
|
-
- AGENTS.md
|
|
43
|
-
|
|
44
|
-
### Changed
|
|
45
|
-
|
|
46
|
-
- appraisal2 v3.0.6
|
|
47
|
-
- kettle-test v1.0.10
|
|
48
|
-
- stone_checksums v1.0.3
|
|
49
|
-
- ast-merge v4.0.6
|
|
50
|
-
- tree_haver v5.0.5
|
|
51
|
-
- tree_stump v0.2.0
|
|
52
|
-
- fork no longer required, updates all applied upstream
|
|
53
|
-
- Updated documentation on hostile takeover of RubyGems
|
|
54
|
-
- https://dev.to/galtzo/hostile-takeover-of-rubygems-my-thoughts-5hlo
|
|
55
|
-
|
|
56
|
-
## [1.0.2] - 2026-02-01
|
|
57
|
-
|
|
58
|
-
- TAG: [v1.0.2][1.0.2t]
|
|
59
|
-
- COVERAGE: 93.12% -- 1611/1730 lines in 25 files
|
|
60
|
-
- BRANCH COVERAGE: 81.52% -- 525/644 branches in 25 files
|
|
61
|
-
- 96.92% documented
|
|
62
|
-
|
|
63
|
-
### Added
|
|
64
|
-
|
|
65
|
-
- More tests
|
|
66
|
-
|
|
67
|
-
### Changed
|
|
68
|
-
|
|
69
|
-
- Documentation cleanup
|
|
70
|
-
- Upgrade to [ast-merge v4.0.5](https://github.com/kettle-rb/ast-merge/releases/tag/v4.0.5)
|
|
71
|
-
- Upgrade to [tree_haver v5.0.3](https://github.com/kettle-rb/tree_haver/releases/tag/v5.0.3)
|
|
72
|
-
|
|
73
|
-
## [1.0.1] - 2026-01-20
|
|
74
|
-
|
|
75
|
-
- TAG: [v1.0.1][1.0.1t]
|
|
76
|
-
- COVERAGE: 93.12% -- 1611/1730 lines in 25 files
|
|
77
|
-
- BRANCH COVERAGE: 81.52% -- 525/644 branches in 25 files
|
|
78
|
-
- 96.92% documented
|
|
79
|
-
|
|
80
|
-
### Changed
|
|
81
|
-
|
|
82
|
-
- Upgrade to [ast-merge v4.0.3](https://github.com/kettle-rb/ast-merge/releases/tag/v4.0.3)
|
|
83
|
-
|
|
84
|
-
## [1.0.0] - 2026-01-19
|
|
85
|
-
|
|
86
|
-
- TAG: [v1.0.0][1.0.0t]
|
|
87
|
-
- COVERAGE: 91.43% -- 1803/1972 lines in 29 files
|
|
88
|
-
- BRANCH COVERAGE: 79.10% -- 579/732 branches in 29 files
|
|
89
|
-
- 96.92% documented
|
|
90
|
-
|
|
91
|
-
### Added
|
|
92
|
-
|
|
93
|
-
- **Cleanse Module**: New namespace for document cleansing/repair utilities
|
|
94
|
-
- `Cleanse::CondensedLinkRefs` - Fixes condensed link reference definitions caused by previous merge bugs
|
|
95
|
-
- Parslet-based PEG parser (linear-time, ReDoS-safe) for detecting and expanding `[label]: url[label2]: url2` → separate lines
|
|
96
|
-
- Detects two corruption patterns: (1) multiple definitions on same line, (2) content before definition without newline
|
|
97
|
-
- Methods: `#condensed?`, `#expand`, `#definitions`, `#count`
|
|
98
|
-
- `Cleanse::CodeFenceSpacing` - Fixes malformed code fence language tags
|
|
99
|
-
- Fixes ` ``` console` → ` ```console` (removes space between backticks and language)
|
|
100
|
-
- Parslet-based PEG parser (linear-time, ReDoS-safe) for detecting code blocks and their info strings
|
|
101
|
-
- Supports any indentation level (handles code blocks nested in lists)
|
|
102
|
-
- Methods: `#malformed?`, `#malformed_count`, `#code_blocks`, `#fix`
|
|
103
|
-
- `Cleanse::BlockSpacing` - Fixes missing blank lines between block elements
|
|
104
|
-
- Detects and fixes missing blank lines after thematic breaks (`---`)
|
|
105
|
-
- Detects and fixes missing blank lines between list items and headings
|
|
106
|
-
- Detects and fixes missing blank lines between markdown and HTML blocks
|
|
107
|
-
- Detects and fixes missing blank lines before HTML when preceded by markdown
|
|
108
|
-
- Special handling for markdown container closing tags (e.g., `</details>`) - adds blank lines before them even when inside HTML blocks, since their content may be markdown
|
|
109
|
-
- Methods: `#malformed?`, `#issue_count`, `#issues`, `#fix`
|
|
110
|
-
- **Security Note**: `CondensedLinkRefs` and `CodeFenceSpacing` use PEG parsers instead of regex to eliminate ReDoS vulnerabilities. Both process untrusted Markdown input safely in O(n) time.
|
|
111
|
-
- **LinkParser tree-based nesting detection**:
|
|
112
|
-
- `#find_all_link_constructs(content)` - Returns tree structure with `:children` for nested items
|
|
113
|
-
- `#build_link_tree(links, images)` - Detects containment and builds parent-child relationships
|
|
114
|
-
- `#flatten_leaf_first(items)` - Flattens tree in post-order (children before parents) for safe replacement
|
|
115
|
-
- Properly handles linked images like `[](link-url)` as parent link with child image
|
|
116
|
-
- **`bin/fix_readme_formatting`**: Updated to include `BlockSpacing` cleanse fix
|
|
117
|
-
- Now fixes missing blank lines between block elements (thematic breaks, lists, headings, HTML)
|
|
118
|
-
- Runs as Phase 1c after CondensedLinkRefs and CodeFenceSpacing
|
|
119
|
-
- **MergeGemRegistry Integration**: Registers with `Ast::Merge::RSpec::MergeGemRegistry`
|
|
120
|
-
- Enables automatic RSpec dependency tag support
|
|
121
|
-
- Registers as category `:markdown` with `skip_instantiation: true` (requires backend)
|
|
122
|
-
- **TestableNode-based spec helpers**: New helper methods using `TreeHaver::RSpec::TestableNode`
|
|
123
|
-
for creating real node instances in tests instead of fragile mocks
|
|
124
|
-
- `create_test_node(type, text:, start_line:, ...)` - Create any node type
|
|
125
|
-
- `create_test_table_node(rows:, text:)` - Create table nodes
|
|
126
|
-
- `create_test_row_node(cells:, start_line:)` - Create table row nodes
|
|
127
|
-
- `create_test_cell_node(content:, start_line:)` - Create table cell nodes
|
|
128
|
-
- `create_test_paragraph_node(content:, start_line:)` - Create paragraph nodes
|
|
129
|
-
- `create_test_heading_node(level:, content:, start_line:)` - Create heading nodes
|
|
130
|
-
- `create_test_code_block_node(content:, language:, start_line:)` - Create code block nodes
|
|
131
|
-
- `create_test_list_node(items:, ordered:, start_line:)` - Create list nodes
|
|
132
|
-
- `create_test_block_quote_node(content:, start_line:)` - Create block quote nodes
|
|
133
|
-
- `create_test_thematic_break_node(start_line:)` - Create thematic break nodes
|
|
134
|
-
- `create_test_html_block_node(content:, start_line:)` - Create HTML block nodes
|
|
135
|
-
- **LinkParser**: New Parslet-based PEG parser for markdown link structures
|
|
136
|
-
- Properly handles emoji in labels (e.g., `[🖼️galtzo-discord]`)
|
|
137
|
-
- Handles multi-byte UTF-8 characters without regex limitations
|
|
138
|
-
- Handles nested brackets (for linked images like `[![alt][ref]](url)`)
|
|
139
|
-
- Parses link reference definitions: `[label]: url` and `[label]: url "title"`
|
|
140
|
-
- Parses inline links: `[text](url)` and `[text](url "title")`
|
|
141
|
-
- Parses inline images: `` and ``
|
|
142
|
-
- Methods: `#parse_definitions`, `#parse_definition_line`, `#find_inline_links`, `#find_inline_images`, `#build_url_to_label_map`
|
|
143
|
-
- **DocumentProblems**: New class for tracking document issues found during merge
|
|
144
|
-
- Categories: `:duplicate_link_definition`, `:excessive_whitespace`, `:link_has_title`, `:image_has_title`, `:link_ref_spacing`
|
|
145
|
-
- Severity levels: `:info`, `:warning`, `:error`
|
|
146
|
-
- Methods: `#add`, `#by_category`, `#by_severity`, `#warnings`, `#errors`, `#infos`, `#merge!`, `#summary_by_category`, `#summary_by_severity`
|
|
147
|
-
- Accessible via `MergeResult#problems` after merge
|
|
148
|
-
- **WhitespaceNormalizer**: New class for normalizing excessive whitespace
|
|
149
|
-
- Supports multiple normalization modes:
|
|
150
|
-
- `:basic` (or `true`) - Collapse excessive blank lines (3+ → 2)
|
|
151
|
-
- `:link_refs` - Basic + remove blank lines between consecutive link reference definitions
|
|
152
|
-
- `:strict` - All normalizations (same as :link_refs currently)
|
|
153
|
-
- Class method: `WhitespaceNormalizer.normalize(content, mode: :basic)`
|
|
154
|
-
- Instance usage tracks problems for introspection
|
|
155
|
-
- New `:link_ref_spacing` problem category for tracking removed blank lines between link refs
|
|
156
|
-
- **LinkReferenceRehydrator**: New class for converting inline links to reference style
|
|
157
|
-
- Converts inline links `[text](url)` to `[text][label]` when matching definition exists
|
|
158
|
-
- Converts inline images `` to `![alt][label]` when matching definition exists
|
|
159
|
-
- Skips links/images with titles (would lose title information)
|
|
160
|
-
- Tracks duplicate definitions and title conflicts in problems
|
|
161
|
-
- Prefers shortest label when multiple labels point to same URL
|
|
162
|
-
- **SmartMergerBase options**:
|
|
163
|
-
- `normalize_whitespace: false | true | :basic | :link_refs | :strict` - whitespace normalization mode
|
|
164
|
-
- `rehydrate_link_references: false` - convert inline links to reference style
|
|
165
|
-
- **PartialTemplateMerger options**:
|
|
166
|
-
- `normalize_whitespace: false | true | :basic | :link_refs | :strict` - whitespace normalization mode
|
|
167
|
-
- `rehydrate_link_references: false` - convert inline links to reference style
|
|
168
|
-
- **MergeResult#problems**: Access `DocumentProblems` instance for introspection
|
|
169
|
-
- **OutputBuilder**: New class for building markdown output from merge operations
|
|
170
|
-
- Consolidates all output assembly logic in one place
|
|
171
|
-
- Handles node source extraction, link definition reconstruction, gap lines
|
|
172
|
-
- Replaces manual string concatenation with clean builder pattern
|
|
173
|
-
- Public methods: `add_node_source`, `add_link_definition`, `add_gap_line`, `add_raw`, `to_s`, `empty?`, `clear`
|
|
174
|
-
- **LinkDefinitionFormatter**: New module for formatting link reference definitions
|
|
175
|
-
- Reconstructs link definitions that parsers consume during parsing
|
|
176
|
-
- Methods: `format(node)`, `format_all(nodes)`
|
|
177
|
-
- **Position-based signature generator for PartialTemplateMerger**:
|
|
178
|
-
- Tables (and other elements) at the same relative position in their sections now match
|
|
179
|
-
- Fixes the "duplicate tables" bug where tables with different column structures weren't merged
|
|
180
|
-
- Template table replaces destination table when both are at the same position within the section
|
|
181
|
-
- Position counters reset for each document, ensuring template and destination tables match
|
|
182
|
-
- **PartialTemplateMerger**: Markdown-specific implementation for partial template merging
|
|
183
|
-
- Extends `Ast::Merge::PartialTemplateMergerBase` with markdown-specific logic
|
|
184
|
-
- Heading-level-aware section boundaries (finds next heading of same or higher level)
|
|
185
|
-
- Source-based text extraction via `analysis.source_range` to preserve:
|
|
186
|
-
- Link reference definitions (no conversion to inline links)
|
|
187
|
-
- Table column padding/alignment
|
|
188
|
-
- Original formatting exactly as written
|
|
189
|
-
- Supports both Markly and Commonmarker backends via tree_haver
|
|
190
|
-
- **SmartMergerBase**: `add_template_only_nodes` now accepts a callable filter
|
|
191
|
-
- Boolean `true`/`false` still works as before (add all or none)
|
|
192
|
-
- Callable (Proc/Lambda) receives `(node, entry)` and returns truthy to add the node
|
|
193
|
-
- Enables selective addition of template-only nodes based on signature, type, or content
|
|
194
|
-
- Useful for partial template merging where only specific template nodes should be added
|
|
195
|
-
|
|
196
|
-
### Changed
|
|
197
|
-
|
|
198
|
-
- Upgrade to [ast-merge v4.0.2](https://github.com/kettle-rb/ast-merge/releases/tag/v4.0.2)
|
|
199
|
-
- Upgrade to [tree_haver v5.0.2](https://github.com/kettle-rb/tree_haver/releases/tag/v5.0.2)
|
|
200
|
-
- **WhitespaceNormalizer refactored to use LinkParser**
|
|
201
|
-
- Removed `LINK_REF_PATTERN` regex constant
|
|
202
|
-
- Now uses `LinkParser#parse_definition_line` for link definition detection
|
|
203
|
-
- Supports all link definition formats that LinkParser handles:
|
|
204
|
-
- Angle-bracketed URLs: `[label]: <url>`
|
|
205
|
-
- Emoji in labels: `[🎨logo]: url`
|
|
206
|
-
- Definitions with titles in any quote style
|
|
207
|
-
- Completely regex-free implementation
|
|
208
|
-
- **LinkDefinitionNode**: Now uses `LinkParser` (Parslet-based) instead of regex for parsing
|
|
209
|
-
- Properly handles emoji in labels (e.g., `[🖼️galtzo-discord]`)
|
|
210
|
-
- More robust parsing of multi-byte UTF-8 characters
|
|
211
|
-
- **LinkReferenceRehydrator**: Rewritten to use `LinkParser` (Parslet-based) for all parsing
|
|
212
|
-
- Uses `LinkParser#parse_definitions` to parse link reference definitions
|
|
213
|
-
- Uses `LinkParser#find_inline_links` and `#find_inline_images` to find inline constructs
|
|
214
|
-
- Properly handles linked images (e.g., `[![alt][ref]](url)`)
|
|
215
|
-
- Properly handles emoji in link text and URLs
|
|
216
|
-
- No regex used - all parsing via PEG grammar
|
|
217
|
-
- **PartialTemplateMerger#find_section_end**: For headings, now always uses heading-level-aware logic, ignoring tree-depth-based boundary from `InjectionPointFinder`
|
|
218
|
-
- Fixes duplicate H4 section bug where nested headings (e.g., H4 inside H3) were incorrectly treated as section boundaries
|
|
219
|
-
- In Markdown, all headings are siblings at the same tree depth regardless of level (H2, H3, H4), so tree depth cannot determine section boundaries
|
|
220
|
-
- Heading level semantics require comparing actual heading level numbers (H3 < H4 means H4 is nested)
|
|
221
|
-
- **SmartMergerBase**: Refactored to use OutputBuilder throughout
|
|
222
|
-
- `process_alignment` now returns OutputBuilder instead of array
|
|
223
|
-
- New methods: `process_match_to_builder`, `process_template_only_to_builder`, `process_dest_only_to_builder`
|
|
224
|
-
- Old methods deprecated but kept for compatibility
|
|
225
|
-
- Inner merge for code blocks now uses `try_inner_merge_code_block_to_builder`
|
|
226
|
-
- **OutputBuilder**: Enhanced node extraction to handle `source_position` method
|
|
227
|
-
- Supports nodes with `source_position` hash
|
|
228
|
-
- Falls back to `to_commonmark` if position unavailable
|
|
229
|
-
- Handles FreezeNode, LinkDefinitionNode, GapLineNode, and parser nodes
|
|
230
|
-
- **FileAnalysisBase**: Added `@errors` instance variable and `errors` attr_reader
|
|
231
|
-
- `valid?` now checks both `@errors.empty?` and `!@document.nil?`
|
|
232
|
-
- Consistent with bash-merge, json-merge, jsonc-merge, and toml-merge patterns
|
|
233
|
-
- **FileAnalysis error handling**: Now rescues `TreeHaver::Error` in `parse_document`
|
|
234
|
-
- `TreeHaver::Error` inherits from `Exception`, not `StandardError`
|
|
235
|
-
- `TreeHaver::NotAvailable` is a subclass of `TreeHaver::Error`, so it's also caught
|
|
236
|
-
- Stores error in `@errors` and returns nil, so `valid?` returns false
|
|
237
|
-
- `SmartMergerBase#parse_and_analyze` then raises the appropriate parse error
|
|
238
|
-
- **Dependency tags**: Refactored to use shared `TreeHaver::RSpec::DependencyTags` from tree_haver gem
|
|
239
|
-
- All dependency detection is now centralized in tree_haver
|
|
240
|
-
- Use `require "tree_haver/rspec"` for shared RSpec configuration
|
|
241
|
-
- `MarkdownMergeDependencies` is now an alias to `TreeHaver::RSpec::DependencyTags`
|
|
242
|
-
- Enables `MARKDOWN_MERGE_DEBUG=1` for dependency summary output
|
|
243
|
-
- Inner-merge dependencies (`:toml_merge`, `:json_merge`, `:prism_merge`, `:psych_merge`) now available
|
|
244
|
-
- **CodeBlockMerger**: Refactored class methods to remove redundant error handling
|
|
245
|
-
- Removed duplicate `rescue` blocks from `merge_with_prism`, `merge_with_psych`, `merge_with_json`, `merge_with_toml`
|
|
246
|
-
- Error handling is now consolidated in `merge_code_blocks` instance method
|
|
247
|
-
- Class methods now raise exceptions which are caught by `merge_code_blocks`
|
|
248
|
-
- Updated specs to test through `merge_code_blocks` (the intended API) instead of class methods directly
|
|
249
|
-
|
|
250
|
-
### Fixed
|
|
251
|
-
|
|
252
|
-
- **CondensedLinkRefs false positive**: Fixed bug where reference-style links followed by colon
|
|
253
|
-
(e.g., `**[Floss-Funding.dev][🖇floss-funding.dev]:**`) were incorrectly detected as condensed
|
|
254
|
-
link reference definitions
|
|
255
|
-
- The pattern `][label]:` was matching, but this is a reference link with punctuation, not a link def
|
|
256
|
-
- Now requires URL-like content after `]:` to confirm it's a real link def
|
|
257
|
-
- Supports both full URLs (`https://...`) and relative paths (`CONTRIBUTING.md`, `LICENSE.txt`)
|
|
258
|
-
- The relative path pattern matches `UPPERCASE.ext` format common in repo files
|
|
259
|
-
- Prevents incorrect newline insertion inside markdown links
|
|
260
|
-
- **LinkReferenceRehydrator content corruption**: Fixed critical bug where rehydrating linked images
|
|
261
|
-
like `[](link-url)` would corrupt document content
|
|
262
|
-
- The parser was finding both the outer link and inner image as separate items
|
|
263
|
-
- Replacing both overlapping items corrupted the content, losing significant portions of documents
|
|
264
|
-
- Now uses tree-based approach: builds parent-child relationships for nested constructs
|
|
265
|
-
- Processes replacements recursively: children are processed first, then parent text is updated
|
|
266
|
-
to include child replacements before parent is processed
|
|
267
|
-
- Single pass now handles all nested structures (no more multi-pass workaround needed)
|
|
268
|
-
- Test fixture showed 68 lines lost (1023 → 955) before fix, now preserves all content
|
|
269
|
-
- **OutputBuilder**: Fixed link definitions being concatenated without newlines
|
|
270
|
-
- `extract_source` for `LinkDefinitionNode` now includes trailing newline
|
|
271
|
-
- Link definitions are now properly output on separate lines
|
|
272
|
-
- **OutputBuilder**: Fixed auto-spacing to properly handle link_definition transitions
|
|
273
|
-
- Removed `link_definition` from the skip list for auto-spacing
|
|
274
|
-
- Now correctly adds blank lines when transitioning FROM link_definition TO other content (e.g., headings)
|
|
275
|
-
- `MarkdownStructure.needs_blank_between?` now handles contiguous types properly
|
|
276
|
-
- **MarkdownStructure**: Added support for contiguous node types
|
|
277
|
-
- New `CONTIGUOUS_TYPES` constant for node types that should not have blank lines between consecutive instances
|
|
278
|
-
- `link_definition` is now a contiguous type - consecutive link definitions won't have blank lines inserted
|
|
279
|
-
- Added `link_definition` to `NEEDS_BLANK_AFTER` - link definition blocks get blank line after when followed by other content
|
|
280
|
-
- New `contiguous_type?` method to check if a type is contiguous
|
|
281
|
-
- `needs_blank_between?` now returns `false` for consecutive nodes of the same contiguous type
|
|
282
|
-
- **PartialTemplateMerger#node_to_text**: Fixed double blank line bug
|
|
283
|
-
- `source_range` already adds trailing newlines, so adding another `"\n"` caused double blank lines
|
|
284
|
-
- Removed the extra `+ "\n"` that was causing excessive blank lines in merged output
|
|
285
|
-
- **Lint cleanup**: Fixed RSpec/ReceiveMessages cops by combining multiple `receive` stubs
|
|
286
|
-
- **Style fixes**: Fixed Style/ClassMethodsDefinitions in `LinkDefinitionNode` using `class << self`
|
|
287
|
-
- **Layout fixes**: Removed extra blank lines in `mock_helpers.rb`
|
|
288
|
-
- **Freeze block detection**: Fixed `find_freeze_markers` to handle both raw parser types
|
|
289
|
-
(`:html`) and TreeHaver normalized types (`"html_block"`, `:html_block`). Previously,
|
|
290
|
-
freeze markers were not detected when using TreeHaver backends because the node type
|
|
291
|
-
check only looked for `:html`.
|
|
292
|
-
- **Freeze marker content extraction**: Now uses a three-tier fallback for extracting
|
|
293
|
-
HTML comment content:
|
|
294
|
-
1. `string_content` (raw Markly/Commonmarker nodes)
|
|
295
|
-
2. `to_commonmark` on the wrapper node
|
|
296
|
-
3. `inner_node.to_commonmark` (TreeHaver Commonmarker wrapper)
|
|
297
|
-
This fixes freeze block detection for Commonmarker where the TreeHaver wrapper's
|
|
298
|
-
content methods return empty but the inner node has the actual content.
|
|
299
|
-
|
|
300
|
-
[Unreleased]: https://github.com/kettle-rb/markdown-merge/compare/v1.0.3...HEAD
|
|
301
|
-
[1.0.3]: https://github.com/kettle-rb/markdown-merge/compare/v1.0.2...v1.0.3
|
|
302
|
-
[1.0.3t]: https://github.com/kettle-rb/markdown-merge/releases/tag/v1.0.3
|
|
303
|
-
[1.0.2]: https://github.com/kettle-rb/markdown-merge/compare/v1.0.1...v1.0.2
|
|
304
|
-
[1.0.2t]: https://github.com/kettle-rb/markdown-merge/releases/tag/v1.0.2
|
|
305
|
-
[1.0.1]: https://github.com/kettle-rb/markdown-merge/compare/v1.0.0...v1.0.1
|
|
306
|
-
[1.0.1t]: https://github.com/kettle-rb/markdown-merge/releases/tag/v1.0.1
|
|
307
|
-
[1.0.0]: https://github.com/kettle-rb/markdown-merge/compare/76f2230840b236dd10fdd7baf322c082762dddb0...v1.0.0
|
|
308
|
-
[1.0.0t]: https://github.com/kettle-rb/markdown-merge/tags/v1.0.0
|
data/CITATION.cff
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: markdown-merge
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this work and you want to cite it,
|
|
5
|
-
then you can use the metadata from this file.
|
|
6
|
-
type: software
|
|
7
|
-
authors:
|
|
8
|
-
- given-names: Peter Hurn
|
|
9
|
-
family-names: Boling
|
|
10
|
-
email: peter@railsbling.com
|
|
11
|
-
affiliation: railsbling.com
|
|
12
|
-
orcid: 'https://orcid.org/0009-0008-8519-441X'
|
|
13
|
-
identifiers:
|
|
14
|
-
- type: url
|
|
15
|
-
value: 'https://github.com/kettle-rb/markdown-merge'
|
|
16
|
-
description: markdown-merge
|
|
17
|
-
repository-code: 'https://github.com/kettle-rb/markdown-merge'
|
|
18
|
-
abstract: >-
|
|
19
|
-
markdown-merge
|
|
20
|
-
license: See license file
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
-
identity and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
-
community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
-
any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email address,
|
|
35
|
-
without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official email address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
[![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact].
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series of
|
|
86
|
-
actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
-
ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
-
community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.1, available at
|
|
119
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by
|
|
122
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
123
|
-
|
|
124
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
125
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
126
|
-
[https://www.contributor-covenant.org/translations][translations].
|
|
127
|
-
|
|
128
|
-
[homepage]: https://www.contributor-covenant.org
|
|
129
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
130
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
131
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
132
|
-
[translations]: https://www.contributor-covenant.org/translations
|
|
133
|
-
[🚂maint-contact]: http://www.railsbling.com/contact
|
|
134
|
-
[🚂maint-contact-img]: https://img.shields.io/badge/Contact-Maintainer-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red
|