fix(convert): route html → markdown through htmlToMarkdown#180
Merged
Conversation
The convert command was routing the html → markdown conversion through storageToMarkdown, which is built for Confluence storage XML (with <ac:*> macros and a specific schema). General HTML inputs may not match that schema and can be misinterpreted. Route this path through the dedicated htmlToMarkdown converter that already exists on the local converter surface, and add a CLI test for the path.
The previous test used <strong>/<em>, which both htmlToMarkdown and storageToMarkdown convert identically — so it would still pass if the routing were reverted to storageToMarkdown. Replace with a multi-line <pre><code class="language-js"> block, which storageToMarkdown collapses into inline `code` (losing the fence and the language tag) while htmlToMarkdown preserves the fenced block. The test now fails on regression and passes on the fix.
github-actions Bot
pushed a commit
that referenced
this pull request
May 10, 2026
## [2.6.1](v2.6.0...v2.6.1) (2026-05-10) ### Bug Fixes * **convert:** route html → markdown through htmlToMarkdown ([#180](#180)) ([384d631](384d631))
|
🎉 This PR is included in version 2.6.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
3 tasks
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.
Summary
convert --input-format html --output-format markdownpath was callingconverter.storageToMarkdown(input).storageToMarkdownis built for Confluence storage XML (<ac:*>macros, a specific schema). Plain HTML inputs do not match that schema and can be misinterpreted.converter.htmlToMarkdown(input)API instead.Test plan
html to markdownintests/convert.test.jscovers the pathnpm run lintpassesnpm test— 670 tests across 15 suites pass (was 669)