Repository navigation
fix: restore legacy CommonMarker compatibility for 6.1.1 - #2114
Merged
Merged
Conversation
I retain the existing CommonMarker 2.x adapter and delegate to the original render_html API when the legacy parser is installed. Existing installations keep their parser and its option behavior. I prepare version `6.1.1` with real-parser regression tests and a legacy full-suite CI job. The incompatible `6.1.0` release has been withdrawn. Co-authored-by: Copilot <[email protected]> Copilot-Session: 6fe372b1-3ff6-4129-9d33-be564fb6a5f0 Signed-off-by: Zack Koppert <[email protected]>
I keep the development version override in the README and place full test commands in CONTRIBUTING. I correct comments about modern-only extensions without changing rendering. Co-authored-by: Copilot <[email protected]> Copilot-Session: 6fe372b1-3ff6-4129-9d33-be564fb6a5f0 Signed-off-by: Zack Koppert <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The public rendering-path change and release preparation warrant final maintainer review.
1 open issue
What changed in this PR
Restores legacy CommonMarker compatibility for 6.1.1 while preserving the modern rendering adapter.
Changes:
- Detect and use the installed parser’s API.
- Add regression tests, legacy-parser CI coverage, and development overrides.
- Prepare 6.1.1 and document the 6.1.0 withdrawal.
| File | Description |
|---|---|
test/test_helper.rb |
Share constant-stubbing support. |
test/markdown_test.rb |
Add parser compatibility regression tests. |
test/coverage_test.rb |
Reuse the shared stubbing helper. |
README.md |
Document parser support and overrides. |
lib/github/markup/markdown.rb |
Restore legacy API dispatch; clarify comments. |
lib/github-markup.rb |
Set version to 6.1.1. |
HISTORY.md |
Record compatibility restoration and withdrawal. |
Gemfile.lock |
Update the local gem version. |
Gemfile |
Allow a CommonMarker version override. |
CONTRIBUTING.md |
Document legacy-parser testing commands. |
.github/workflows/ci.yml |
Add legacy coverage, adjust dependency resolution, and harden checkout configuration. |
Review effort: Max
| $ RDOC_VERSION='~> 8.0' bundle update rdoc | ||
| $ RDOC_VERSION='~> 8.0' bundle exec rake | ||
|
|
||
| CI also tests CommonMarker 0.23.12. To run the full suite with the legacy parser: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
Existing CommonMarker 0.x installations cannot use the withdrawn
6.1.0release without upgrading their parser. Markdown rendering raisesNameErrorbecause that release calls the CommonMarker 2.x API unconditionally.I restored the legacy API so consumers can adopt the RDoc 8 and reStructuredText fixes without changing their installed CommonMarker version. The number of affected installations is unknown.
What changed
I use the installed parser's API:
CommonMarker.render_htmlfor legacy installations and the existingCommonmarker.to_htmladapter for modern installations. I preserve native legacy options, errors, and extension limits without changing modern rendering behavior.I prepare
6.1.1, document the6.1.0withdrawal, and retain the RDoc 8 and reStructuredText fixes. CommonMarker remains optional; the default development bundle stays at2.8.2.I added real-parser regression tests, a full-suite CommonMarker
0.23.12CI job, and a documentedCOMMONMARKER_VERSIONdevelopment override.I also disabled persisted checkout credentials and updated the pinned Ruby setup action while editing the workflow. Parser-override jobs resolve their dependencies without the default bundle cache.
Before and after
6.1.06.1.10.23.12installedNameError6.0.0behavior is preserved2.8.2installedAlternatives considered
I chose direct API detection rather than reverting modern support or requiring a dependency upgrade. Each parser keeps its own behavior; this does not make legacy and modern output identical.
Testing
I ran the complete 71-test suite in a fresh Linux Codespace across five profiles. I tested CommonMarker
2.8.2and0.23.12with RDoc 7.2/8.1, plus an unchanged public legacy fork. Every profile passed with 100% measured line and branch coverage.I built and installed the candidate gem, then exercised real Markdown, RDoc, and reStructuredText rendering across four parser/RDoc profiles. All 15 legacy output/error comparisons matched the published
6.0.0gem with the same unchanged parser.I also exercised both public rendering APIs and the installed CLI, including frozen inputs, native parser errors, and Markdown rendering without CommonMarker installed.
Rollout
I'll publish
6.1.1only after review, merge, and separate release approval. The historicalv6.1.0andv7.0.0tags remain unchanged.Consumers can retain their current CommonMarker pin and test the dependency update independently. If adoption fails, they can restore their previous
github-markuppin.What to watch after merge
I'll check the parser compatibility CI workflow. During adoption, watch the consuming application's Markdown-rendering errors, especially
NameErrorand unexpected parser-option errors.