web_dev_html_to_markdown
Convert HTML to Markdown using fast regex-based rules, handling headings, bold, italic, links, images, code, blockquotes, lists, and tables. Runs locally and returns Markdown string with stats.
Instructions
HTML to Markdown Converter. Convert an HTML fragment or document into Markdown using fast regex-based rules: headings (h1-h6), bold/italic/strikethrough, links, images, inline code and fenced code blocks, blockquotes, horizontal rules, ordered and unordered lists, and tables (rendered as GFM pipe tables). Unrecognised tags are stripped and HTML entities are decoded. Use this to turn web content, emails, or HTML documents into Markdown; use web_dev_markdown_to_html for the inverse (Markdown to HTML), and webdev_html_minifier when you only want to shrink HTML rather than convert it. Runs locally on the input you provide: read-only, non-destructive, deterministic, offline, contacts no external service, and is rate-limited (anonymous 60 req/min, 500/hr). Returns the Markdown string, a stats object counting converted elements, and the whitespace-normalised source HTML. Note: the three options are accepted for forward compatibility but do not currently change the output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML source to convert. Required and must be non-empty, or a 400 is returned. | |
| options | No | Reserved options. Currently accepted but ignored; output is identical whether or not they are set. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | No | The converted Markdown output. | |
| stats | No | Counts derived from the input HTML and resulting Markdown. | |
| cleaned_html | No | The input HTML with runs of whitespace collapsed and trimmed. |