# Convert HTML to markdown Source: https://neondeerdata.com/docs/platform/automations/steps/convert-html-to-markdown/ Step ยท Transform Converts HTML, such as an email body, into markdown text. ## Inputs | Label | Key | Type | Required | Notes | | ----- | ------ | ---- | -------- | ---------------------------- | | HTML | `html` | Text | Yes | Plain text is also accepted. | ## Outputs | Label | Key | Type | Always set | Notes | | -------- | ---------- | ---- | ---------- | ------------- | | Markdown | `markdown` | Text | Yes | Can be empty. | ## How it behaves - Parses with HTML5 error recovery, sanitizes (GitHub allowlist plus tables), then writes GitHub-flavored markdown. - Removes `script`, `style`, `svg`, `head`, `title`, `meta`, `link`, `noscript`, `iframe`, `object`, `embed` and `template` elements, and elements hidden with inline `display:none`, `visibility:hidden`, `mso-hide:all`, `opacity:0` or the `hidden` attribute. - Images become `[Image: alt](url)` links (inside a link, only the label text is kept). `cid:` and `data:` images and tracking pixels of 1px or less are dropped. - Layout tables (`role="presentation"`, or no header cells or caption) are flattened; data tables become markdown tables. - Links keep only `http`, `https`, `mailto` and `tel` schemes; others become plain text. Inline-style bold and italic on `span`/`font` are kept. ## Limits and constraints - Input up to 1,000,000 characters. ## Errors Fails when - Empty: `HTML is required.` - Too long: `HTML is too large to convert (over 1,000,000 characters).` - Parser failure: `The HTML could not be converted (malformed or too deeply nested).` For errors that every step can return, see [Troubleshooting](https://neondeerdata.com/docs/platform/automations/troubleshooting/). ## Notes - Hiding done with stylesheets or classes is not detected; only inline styles are. ## Example Clean up an HTML email body before saving it as a note. **Example inputs** | Input | Value | | ----- | ------------------------------------------------------------------------------------------------------------------------------------------ | | HTML | `

Hi Sam, see our terms.

` `` | **Example outputs** | Output | Value | | -------- | ------------------------------------------------------ | | Markdown | `Hi **Sam**, see [our terms](https://acme.com/terms).` | The 1px tracking image is dropped.