Convert HTML fragment to Markdown
html_to_markdownConvert arbitrary HTML to Markdown without Readability article scoring. Ideal for snippets already extracted via browser tools.
Instructions
Convert an arbitrary HTML fragment to Markdown WITHOUT Readability article extraction (e.g. a snippet already isolated via chrome-devtools). Same Turndown + DOMPurify path as extract. The server fetches nothing: html is the only source, and url (optional) absolutizes relative links.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gfm | No | Enable GitHub-Flavored Markdown: tables, strikethrough, and task lists. | |
| url | No | Origin URL for absolutizing relative links and images. NEVER fetched — origin context only. | |
| html | Yes | HTML fragment to convert to Markdown. No Readability article scoring is applied — the fragment is normalized and converted as-is. | |
| format | No | Returned payload format: 'markdown' (default), 'html', 'text', or 'json' (emits {metadata, content, diagnostics}). | markdown |
| images | No | Image handling: 'keep' (inline ), 'drop', 'src-only' (bare URL text), or 'reference' (link-reference style). | keep |
| maxChars | No | Truncate markdown/text output at a block boundary; never splits a fenced code block. Ignored for html/json formats. | |
| sanitize | No | Run DOMPurify over the extracted/fragment HTML before conversion (strips scripts, event handlers, and iframes). | |
| selectors | No | Scope the extracted/converted content by CSS selector before processing. | |
| cleanChrome | No | Strip browser chrome (scrollbars, consent/cookie banners, fixed nav and overlays) before conversion. These elements poison Readability density scoring and clutter fragment output. | |
| headingStyle | No | Markdown heading style: 'atx' (#) or 'setext' (underlining with = / -). | atx |
| metadataMode | No | Prepend a metadata block to the markdown/text payload: 'none' (default), 'yaml', or 'json'. | none |
| codeBlockStyle | No | Markdown code-block style: 'fenced' (triple backticks) or 'indented' (four-space). | fenced |
| wordsPerMinute | No | Reading speed (words per minute) used to compute metadata.readingTimeMin. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The human/LLM-readable payload — Markdown/html/text, or the serialized JSON when format=json. | |
| metadata | Yes | Resolved article metadata. Each field is the first non-empty value across a priority cascade. | |
| diagnostics | Yes | Pipeline telemetry describing what was extracted, sanitized, and removed. | |
| schemaVersion | Yes | Structured-content schema version. Bumps only on breaking shape changes to this object. |