nœuds / builtin / datatransformation
Markdown
Convert HTML to Markdown, or Markdown to HTML
Ce contenu n’est pas encore disponible dans votre langue.
Convert HTML to Markdown, or Markdown to HTML.
Try it
Section titled “Try it”Capture Article as Markdown : un workflow de 4 étapes, qui commence par When Started et se termine par Copy to clipboard.
What it does
Section titled “What it does”HTML to Markdown turns a web page’s markup into clean Markdown. It keeps headings, bold, italic and strikethrough, code, links, images, lists (including nested ones), quotes and tables. Scripts, styles and the page head are dropped.
Markdown to HTML turns Markdown (GitHub style, with tables) into HTML. Anything unsafe, such as scripts, is removed from the result.
The node runs once per incoming item and adds the converted text to it. Content of up to about 2 MB is accepted.
When to use it
Section titled “When to use it”- Before an AI node: raw HTML wastes a lot of the model’s budget on tags. Markdown keeps the structure the model needs at a fraction of the size.
- Save a web page as readable notes, for example in a Notion page.
- Turn an AI answer written in Markdown into HTML for an email or a web page.
- To pick out specific values rather than convert the whole page, use HTML Extract instead.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Operation | Choice | Which way to convert. Options: HTML to Markdown, Markdown to HTML. Par défaut : HTML to Markdown |
| Content | Value | The HTML or Markdown to convert. |
| Source Field | Text | Field holding the content, when the field above is left empty. |
| Keep Links | Toggle | Keep links as [text](url); when off, only the link text is kept. Par défaut : On |
| Keep Images | Toggle | Keep images as ; when off, images are dropped. Par défaut : On |
| Keep Tables | Toggle | Render tables as Markdown tables; when off, cells become plain lines. Par défaut : On |
| Include Input Fields | Toggle | Keep the incoming item’s fields alongside the result. Par défaut : On |
| Put Result In Field | Text | Field holding the converted text. Par défaut : result |
Give the content one of two ways: an expression in Content, such as {{ $input.data }}, or a field name in Source Field, such as data. Content wins when both are filled. Source Field accepts dots for nested fields.
Keep Links, Keep Images and Keep Tables only affect HTML to Markdown. Turning Keep Images off is a good way to shrink text for an AI node.
Outputs
Section titled “Outputs”-
Output
Each item comes out with the converted text in Put Result In Field (result by default). With Include Input Fields off, the item holds only that field. Read it downstream with {{ $input.result }}.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- Get HTML from Link fetches an article page.
- Markdown with Operation HTML to Markdown, Source Field set to the field that holds the HTML, and Keep Images off.
- Summarization with Text
{{ $input.result }}.
Common issues
Section titled “Common issues”- “No content to convert. Fill in the Content field, or name the field holding it.” Both Content and Source Field are empty. Fill in one of them.
- “Field “…” does not exist on the incoming item.“ Source Field names a field the item does not have. Check the spelling against the previous node’s output.
- “Input is … bytes, larger than the 2000000-byte limit this node will parse.” The content is over about 2 MB. Extract the part you need first with HTML Extract.
- The Markdown is mostly menus and footers. The node converts the whole page. Narrow it first with HTML Extract (Return HTML) on the main content, for example
article.
Recipes with this node
Section titled “Recipes with this node”Related nodes
Section titled “Related nodes”- HTML Extract: pick values or a section out of HTML.
- Get HTML from Link: fetch a page’s HTML.
- Text / Formatter: other text clean-ups.