Step · Transform
Convert HTML to markdown
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,embedandtemplateelements, and elements hidden with inlinedisplay:none,visibility:hidden,mso-hide:all,opacity:0or thehiddenattribute. - Images become
[Image: alt](url)links (inside a link, only the label text is kept).cid:anddata: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,mailtoandtelschemes; others become plain text. Inline-style bold and italic onspan/fontare 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.
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.
| Input | Value |
|---|---|
| HTML | |
| Output | Value |
|---|---|
| Markdown | |
The 1px tracking image is dropped.