Skip to content

v2.2.0

Choose a tag to compare

@janreges janreges released this 29 Mar 01:05
· 304 commits to main since this release

New features

  • --html-to-markdown=<file> (-htm) — convert a local HTML file to clean Markdown without crawling. Outputs to stdout (pipe-friendly) or to a file with --html-to-markdown-output=<file>. Uses the same conversion pipeline as --markdown-export-dir including all cleanup, accordion collapsing, code language detection, and implicit exclusions. Respects --markdown-disable-images, --markdown-disable-files, --markdown-exclude-selector, and --markdown-move-content-before-h1-to-end

Markdown export improvements

  • Elements with aria-hidden="true" are now excluded from markdown output — eliminates mega-menu panels and other hidden UI elements (up to 60% noise reduction on some sites)
  • Elements with role="menu" (dropdown/popup menus) are now excluded from markdown output
  • Adjacent block elements (<div>, <section>, <article>, etc.) now produce newline separation — prevents text from concatenating like "text1text2"
  • Icon-only links (SVG, images) now use aria-label as fallback text instead of raw URL — produces [Facebook](...) instead of [https://www.facebook.com/...](...) for social media links
  • Common cookie consent banners are now implicitly excluded (CookieBot, OneTrust, .cookie-banner, .cookie-consent, etc.)

Bug fixes

  • Fixed --markdown-move-content-before-h1-to-end stripping # heading markers — trim_matches was removing markdown-significant characters from the start of the document
  • Fixed --markdown-disable-files removing .html and .htm page links — these are navigation links, not downloadable files
  • Fixed --markdown-disable-files removing tel: and mailto: contact links
  • Fixed empty list items (- ) remaining after image and file removal
  • Fixed orphaned links with filename-as-text (e.g. [some-page.html](some-page.md)) appearing in markdown when media content (video, etc.) was stripped from a link
  • Fixed empty table rows (| | |) remaining after content removal
  • Fixed leading whitespace in link text after image removal ([ text](url) → [text](url))

Testing

  • Added 34 new unit tests covering all markdown export improvements
  • Added 10 new integration tests for the --html-to-markdown mode