Overview of html-to-markdown
mainhtml-to-markdown
html-to-markdown is a high-performance tool designed to convert messy, real-world HTML into clean Markdown (CommonMark) or Djot. It is built with a Rust core and provides bindings for 16 different languages, ensuring consistent results across different environments.
Key Capabilities
- Robust Parsing: Automatically handles unclosed tags, CDATA, custom elements, broken entities, nested tables, and mixed encodings without requiring manual parsing strategy tuning.
- Metadata Extraction: Extracts structured metadata from the
<head>section, including Open Graph, Twitter, JSON-LD, microdata, RDFa, and header hierarchy. - Structured Data: Supports GFM (GitHub Flavored Markdown) tables with padded cells, alignment, and pipe escaping.
- Flexible Output: Supports both CommonMark and Djot (via
output_format = "djot"). - High Performance: Capable of processing 19–116 MB/s on standard corpora.
- Extensibility: Includes a Visitor API for transforming the converted Markdown AST and configurable preprocessing presets (Standard, Strict, and Lenient).