Reference · Tools

Markdown

Convert data between Markdown and HTML.

Action Core Nodes v1

The Markdown node converts between Markdown and HTML in either direction, writing the result to a destination key on the item. It needs no credentials. A typical build is converting a scraped HTML article into clean Markdown before handing it to a model or a knowledge base.

Node type
Action
Parameters
7
Outputs
Output, Error
Credentials
None required

Markdown

Convert between Markdown and HTML

Overview

The Markdown tool converts between Markdown and HTML in both directions. HTML→Markdown uses node-html-markdown with options for bullet markers, code fences, emphasis delimiters, text replacement patterns, and more. Markdown→HTML uses showdown with 25+ options including emoji support, tables, strikethrough, task lists, and GitHub-compatible features.

Category: Core Nodes
Tool Name: markdown
Version: 1

Appearance: Icon: lucide-FileText | Color: #000000

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool does not require any credentials.

Parameters

The two Options collections are mutually exclusive — only the one matching the selected Mode is shown.

ParameterTypeRequiredDefaultDescription
ModeoptionsNohtmlToMarkdownConversion direction.
Options: markdownToHtml (convert data from Markdown to HTML), htmlToMarkdown (convert data from HTML to Markdown)
HTMLstringYesThe HTML to convert to Markdown. Supports expressions like {{ $json.htmlContent }}. (shown when Mode is htmlToMarkdown)
MarkdownstringYesThe Markdown to convert to HTML. Supports expressions like {{ $json.docContent }}. (shown when Mode is markdownToHtml)
Destination KeystringYesdataThe field to put the output in. Supports dot-notation for nested fields.
Options (options)collectionNo{}HTML→Markdown conversion settings. (shown when Mode is htmlToMarkdown)
— Bullet MarkerstringNo*Character used for unordered list bullets.
— Code Block FencestringNo```Fence characters used around code blocks.
— Emphasis DelimiterstringNo_Delimiter used for emphasis (italic) text.
— Global Escape PatternfixedCollectionNo{}A find/replace pair applied across the whole converted document.
— — PatternstringNoRegular expression to match.
— — ReplacementstringNoText to replace each match with.
— Ignored ElementsstringNoComma-separated HTML elements to ignore.
— Keep Images With DatabooleanNofalsePreserve images whose source is a data: URL.
— Line Start Escape PatternfixedCollectionNo{}A find/replace pair applied only at the start of each line.
— — PatternstringNoRegular expression to match.
— — ReplacementstringNoText to replace each match with.
— Max Consecutive New LinesnumberNo3Maximum number of blank lines kept in a row.
— Place URLs At The BottombooleanNofalseUse reference-style links and collect the URLs at the end of the document.
— Strong DelimiterstringNo**Delimiter used for strong (bold) text.
— Style For Code BlockoptionsNofenceHow code blocks are written in the Markdown output.
Options: fence, indented
— Text Replacement PatternfixedCollectionNo[]Find/replace pairs applied to the converted text. Accepts multiple entries.
— — PatternstringNoRegular expression to match.
— — ReplacementstringNoText to replace each match with.
— Treat As BlocksstringNoComma-separated elements to treat as blocks.
Options (options)collectionNo{}Markdown→HTML conversion settings. (shown when Mode is markdownToHtml)
— Add Blank To LinksbooleanNofalseOpen generated links in a new window.
— Automatic Linking to URLsbooleanNofalseTurn bare URLs in the text into links.
— Backslash Escapes HTML TagsbooleanNofalseAllow a backslash to escape an HTML tag so it renders literally.
— Complete HTML DocumentbooleanNofalseEmit a full HTML document rather than a fragment.
— Customized Header IDbooleanNofalseAllow a heading to declare its own id.
— Emoji SupportbooleanNofalseConvert emoji shortcodes into emoji characters.
— Encode EmailsbooleanNotrueObfuscate email addresses to make scraping harder.
— Exclude Trailing Punctuation From URLsbooleanNofalseLeave trailing punctuation outside an auto-generated link.
— GitHub Code BlocksbooleanNotrueSupport GitHub-flavored fenced code blocks.
— GitHub Compatible Header IDsbooleanNofalseGenerate heading ids the way GitHub does.
— GitHub Mention LinkstringNohttps://github.com/{u}Link template used for mentions, where {u} is the user name.
— GitHub MentionsbooleanNofalseTurn @name into a mention link.
— GitHub Task ListsbooleanNofalseRender - [ ] and - [x] as checkboxes.
— Header Level StartnumberNo1Heading level that a single # maps to.
— Mandatory Space Before HeaderbooleanNofalseRequire a space between # and the heading text.
— Middle Word AsterisksbooleanNofalseTreat asterisks inside a word as literal characters.
— Middle Word UnderscoresbooleanNofalseTreat underscores inside a word as literal characters.
— No Header IDbooleanNofalseDo not add ids to headings.
— Parse Image DimensionsbooleanNofalseRead width/height hints in image syntax.
— Prefix Header IDstringNosectionPrefix added to generated heading ids.
— Raw Header IDbooleanNofalseUse the raw heading text as the id without cleaning it up.
— Raw Prefix Header IDbooleanNofalseUse the heading id prefix exactly as written.
— Simple Line BreaksbooleanNofalseTreat a single newline as a line break.
— Smart Indentation FixbooleanNofalseCorrect indentation that would otherwise break nested blocks.
— Spaces Indented SublistsbooleanNofalseDo not require four-space indentation for sublists.
— Split Adjacent BlockquotesbooleanNofalseKeep neighbouring blockquotes as separate blocks.
— StrikethroughbooleanNofalseSupport ~~text~~ strikethrough syntax.
— Tables Header IDbooleanNofalseAdd ids to table header cells.
— Tables SupportbooleanNofalseSupport Markdown table syntax.
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One output item per input item. The converted text is written to the field named by Destination Key (data by default); the rest of the input item JSON passes through unchanged, and binary data is forwarded.

Destination Key accepts dot-notation, so post.markdown creates the nested objects it needs and writes the result at the end of the path.

The source content comes from the HTML or Markdown parameter, not from a fixed field on the item — point it at the item with an expression such as {{ $json.htmlContent }}.

Reference the result downstream by expression, e.g. {{ $json.data }}.

Usage Examples

  • Convert Markdown README to HTML
  • Convert HTML email to Markdown for processing

Example Configuration

Convert HTML to Markdown:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "<h1>Title</h1><p>This is a paragraph.</p>",
    "destinationKey": "markdownOutput"
  }
}

Convert HTML to Markdown with formatting options:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "<h1>Title</h1><ul><li>Item 1</li><li>Item 2</li></ul>",
    "destinationKey": "markdownOutput",
    "options": {
      "bulletMarker": "-",
      "strongDelimiter": "**",
      "maxConsecutiveNewlines": 2,
      "keepDataImages": true
    }
  }
}

Convert HTML to Markdown with a text replacement:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "<p>Hello world</p>",
    "destinationKey": "result",
    "options": {
      "textReplace": {
        "values": [
          {
            "pattern": "world",
            "replacement": "universe"
          }
        ]
      }
    }
  }
}

Convert HTML to Markdown with a global escape:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "<p>Some [bracketed] text</p>",
    "destinationKey": "result",
    "options": {
      "globalEscape": {
        "value": {
          "pattern": "\\[",
          "replacement": "\\\\["
        }
      }
    }
  }
}

Convert HTML to Markdown with a line-start escape:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "<p>## Not a heading</p>",
    "destinationKey": "result",
    "options": {
      "lineStartEscape": {
        "value": {
          "pattern": "^##",
          "replacement": "\\##"
        }
      }
    }
  }
}

Convert Markdown to HTML:

{
  "type": "markdown",
  "parameters": {
    "mode": "markdownToHtml",
    "markdown": "# Title\n\nThis is a **bold** paragraph.",
    "destinationKey": "htmlOutput"
  }
}

Convert Markdown to HTML with GitHub features:

{
  "type": "markdown",
  "parameters": {
    "mode": "markdownToHtml",
    "markdown": "# Project\n\n- [x] Task 1\n- [ ] Task 2",
    "destinationKey": "htmlOutput",
    "options": {
      "ghCodeBlocks": true,
      "tasklists": true,
      "tables": true,
      "strikethrough": true,
      "emoji": true
    }
  }
}

Produce a complete HTML document:

{
  "type": "markdown",
  "parameters": {
    "mode": "markdownToHtml",
    "markdown": "# Welcome\n\nThis is my website.",
    "destinationKey": "fullHtml",
    "options": {
      "completeHTMLDocument": true,
      "openLinksInNewWindow": true,
      "headerLevelStart": 2,
      "prefixHeaderId": "section"
    }
  }
}

Convert scraped HTML posts to Markdown for storage, writing to a nested field:

{
  "type": "markdown",
  "parameters": {
    "mode": "htmlToMarkdown",
    "html": "{{ $json.htmlContent }}",
    "destinationKey": "post.markdown",
    "options": {
      "bulletMarker": "-",
      "codeFence": "~~~",
      "useLinkReferenceDefinitions": false,
      "maxConsecutiveNewlines": 3
    }
  }
}

Render documentation with GitHub features:

{
  "type": "markdown",
  "parameters": {
    "mode": "markdownToHtml",
    "markdown": "{{ $json.docContent }}",
    "destinationKey": "documentation.html",
    "maxConcurrency": 5,
    "options": {
      "ghCodeBlocks": true,
      "tables": true,
      "tasklists": true,
      "ghMentions": true,
      "ghMentionsLink": "https://github.com/{u}",
      "emoji": true
    }
  }
}

Generate email-friendly HTML:

{
  "type": "markdown",
  "parameters": {
    "mode": "markdownToHtml",
    "markdown": "{{ $json.emailTemplate }}",
    "destinationKey": "email.body",
    "options": {
      "simpleLineBreaks": true,
      "encodeEmails": true,
      "noHeaderId": true,
      "openLinksInNewWindow": true
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Converts between Markdown and HTML using showdown (MD→HTML) and node-html-markdown (HTML→MD).

Behavior notes

  • The content is a parameter, not a fixed field. Put an expression in HTML or Markdown — {{ $json.htmlContent }} — to convert whatever the upstream item carries. Leaving it as literal text converts that same text for every item.
  • Destination Key is fixed for the node. It is read once per run, so every item writes its result to the same path.
  • Switching Mode swaps the whole Options set. Settings configured for one direction are not carried over to the other; each direction has its own collection.
  • Use Ignored Elements to drop boilerplate. Passing script, style, nav, footer keeps navigation chrome out of the Markdown when converting scraped pages.
  • Tables and task lists are off by default when converting Markdown to HTML — turn on Tables Support and GitHub Task Lists if your source relies on them.

Frequently asked questions

How do I convert content from the incoming item?

Put an expression in the HTML or Markdown field — `{{ $json.htmlContent }}` — so it converts whatever that item carries. Leaving literal text there converts the same text for every item.

Can each item write to a different output key?

No. Destination Key is read once per run, so every item writes its result to the same path.

Why did my options disappear when I changed direction?

Switching Mode swaps the whole Options set, because the two conversions have different settings. Reconfigure the options after changing direction.

Does it need credentials?

No — the conversion happens locally.

Build with the Markdown node

Drop it into a workflow, wire it to an agent, or call it on a schedule.

Open BusyBot

Last updated . Spotted something wrong? Tell us.