Is the HTML output sanitized?
Yes. Every HTML path runs through an explicit allowlist. Raw HTML embedded in Markdown is escaped by default; set allowRawHtml=true to send it through the sanitizer instead.
Convert Markdown, HTML, and plaintext with sanitization, heading slugs, YAML front matter, and document outlines for content and RAG pipelines.
This calls POST /to-html on the live Markdown Convert API. Preview the HTML source. It is not executed in the page.
Live demo capped at 2,000 characters. HTML is shown as source, not injected.
Rendering HTML...
Why Markdown Convert API
Sanitized HTML by default
Markdown to HTML runs through an explicit allowlist. Raw HTML in Markdown is escaped unless you opt in.
Stable heading slugs
The same heading id appears in rendered HTML and in the outline, so anchors stay consistent.
Document outlines
Headings, classified links and images, code-block languages, word count, and reading time.
Plaintext for embeddings
Block structure as blank lines, optional wrap width, and stats ready for chunking pipelines.
Batch up to 25 documents
One POST /batch call with per-document targets of html, markdown, text, or outline.
No remote fetches
Input arrives in the body only. There is no URL fetch path and no SSRF surface.
/api/v1/markdown-convert
Markdown to HTML
Sanitized HTML with heading slug ids, front matter, footnotes, and stats.
HTML to Markdown
Turn HTML into GFM Markdown with configurable heading and list style.
Plaintext
Markdown or HTML to plaintext with word count and reading time.
Outline
Headings, TOC, links, images, and code-block languages.
Batch
Up to 25 documents, each with its own target.
Capabilities
Targets, input limits, and GFM flavor.
| Parameter | Type | Required | Description |
|---|---|---|---|
| markdown | string | yes* | Required for to-html. One of markdown or html for to-text and outline. |
| html | string | yes* | Required for to-markdown. One of markdown or html for to-text and outline. |
| allowRawHtml | boolean | no | Send embedded raw HTML through the sanitizer. Defaults to false. |
| headingIds | boolean | no | Assign slug ids to headings. Defaults to true. |
| documents | array | yes* | 1-25 documents for POST /batch, each with a target. |
Error reference
Missing, unknown, or invalid body field, or invalid JSON.
Missing or invalid gateway API key. Send x-api-key or api_key with every request.
A field exceeds the 1 MB input limit.
Malformed YAML front matter.
More than 120 requests in a 15-minute window.
Example error response
{
"success": false,
"error": "Invalid request body",
"code": "invalid_json",
"correlationId": "1784849006651-md01"
}FAQ
Yes. Every HTML path runs through an explicit allowlist. Raw HTML embedded in Markdown is escaped by default; set allowRawHtml=true to send it through the sanitizer instead.
POST /batch accepts 1-25 documents, each with a target of html, markdown, text, or outline, and returns per-document results plus a summary.
Yes. outline returns nested headings, a filtered TOC, classified links and images, code-block languages, word count, and reading time.
Each field is capped at 1 MB. Oversized documents return 413. There is no remote URL fetch, so there is no SSRF surface.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
CommonMark plus GFM tables, with YAML front matter parsed into a metadata object.