Skip to content

fix(convert): route html → markdown through htmlToMarkdown#180

Merged
pchuri merged 2 commits into
mainfrom
fix/convert-html-to-markdown
May 10, 2026
Merged

fix(convert): route html → markdown through htmlToMarkdown#180
pchuri merged 2 commits into
mainfrom
fix/convert-html-to-markdown

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented May 10, 2026

Summary

  • The convert --input-format html --output-format markdown path was calling converter.storageToMarkdown(input).
  • storageToMarkdown is built for Confluence storage XML (<ac:*> macros, a specific schema). Plain HTML inputs do not match that schema and can be misinterpreted.
  • Route the html → markdown path through the existing dedicated converter.htmlToMarkdown(input) API instead.

Test plan

  • New CLI test html to markdown in tests/convert.test.js covers the path
  • npm run lint passes
  • npm test — 670 tests across 15 suites pass (was 669)

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.
@pchuri pchuri self-assigned this May 10, 2026
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.
@pchuri pchuri merged commit 384d631 into main May 10, 2026
6 checks passed
@pchuri pchuri deleted the fix/convert-html-to-markdown branch May 10, 2026 05:03
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))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant