Skip to content

Rewritten Markdown Converter

Choose a tag to compare

@pspoerri pspoerri released this 19 Mar 06:58
· 6 commits to main since this release

This release completely rewrites the HTML-to-Markdown conversion pipeline and significantly improves the fidelity of Confluence page rendering.

Highlights

New XML-based conversion engine

The Markdown converter has been rewritten twice in this cycle — first from regex to golang.org/x/net/html, then from net/html to encoding/xml — resulting in a cleaner, more correct, and more maintainable parser that properly handles Confluence's XHTML storage format.

Comprehensive Confluence macro support

  • Panel macros (info, note, warning, tip) are now rendered as GitHub-flavored markdown alerts (> [!NOTE], > [!WARNING], etc.)
  • Children and pagetree macros are expanded with real page data from the cache
  • drawio-sketch, contentbylabel, and attachment macros are handled gracefully
  • Unknown macros and tags are now logged for visibility instead of silently dropped

Lazy attachment fetching

Attachments are now fetched per-page on demand instead of preemptively for all pages, reducing API calls and improving performance for large spaces.

Standardized CLI output

A new internal/ui package provides consistent formatting across all CLI commands.

What's Changed

  • Replace regex-based HTML converter with golang.org/x/net/html parser
  • Replace golang.org/x/net/html parser with encoding/xml for proper XHTML handling
  • Style Confluence panel macros as GitHub-flavored markdown alerts
  • Expand children and pagetree macros with real page data
  • Handle drawio-sketch, pagetree, attachments, contentbylabel and other tags
  • Handle additional Confluence tags and macros in Markdown conversion
  • Log unknown tags and macros during Markdown conversion
  • Fetch attachments lazily per page instead of preemptively for all pages
  • Fix table conversion dropping cells when row mixes th and td tags
  • Add internal/ui package to standardize CLI output formatting

Stats

10 files changed, ~1,800 insertions, ~530 deletions

Full Changelog: v0.3...v0.4

Full Changelog: v0.3...v0.4