Skip to main content
Version: 1.28 (Current)

Markdown to Html

Audience: Low-code Engineers

Skill Prerequisites: Tokens, HTML

Converts Markdown text to HTML and stores the result in a token. It uses the Markdig library with its advanced extensions, so tables, task lists and footnotes work too.

note

This action requires the Scripting feature (Standard.Scripting) to be licensed. If it isn't licensed, the action fails with an error.

Typical Use Cases​

  • Show a reply from an AI model, such as Chat, Aws AI Chat or VertexAI Chat, as formatted HTML. AI replies are often written in Markdown.
  • Let users write notes or descriptions in Markdown and show them as HTML
  • Build the body of an email or a PDF from a Markdown template
  • Render README-style content stored in the database

Don't use it to​

  • Clean or restrict HTML. Use Sanitize Html.
  • Convert HTML back to Markdown. This action only goes one way.
  • Replace text patterns. Use Regex Replace.
Action NameDescription
Sanitize HtmlCleans HTML. Use it on the output when the markdown isn't trusted.
Display MessageShows a message. Put the output token in the message to show the HTML.
ChatSends a message to an OpenAI model. Replies are often Markdown.
Regex ReplaceReplaces text that matches a regular expression.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
MarkdownThe Markdown text to convert, usually a token such as [Reply].Yesempty stringYes
Use BootstrapAdds Bootstrap classes to some elements, for example table on tables and img-fluid on images.NoFalseNo
Output Token NameThe token name that gets the HTML, for example ReplyHtml.Noempty stringNo

Output Parameters Reference​

ParameterDescription
Output Token NameHolds the generated HTML. If Output Token Name is empty, the action does nothing.

Supported Markdown​

Besides standard Markdown (CommonMark), these extensions are on:

  • Pipe tables and grid tables
  • Task lists, such as - [x] Done
  • Footnotes, abbreviations, definition lists and citations
  • Extra emphasis, such as ~~strikethrough~~
  • Auto-links, so https://example.com becomes a link
  • Heading IDs, so # Overview becomes <h1 id="overview">
  • Custom containers (:::), figures and footers
  • Math, so text between $ signs is wrapped as math
  • Media links, so an image link to a video, such as ![](https://www.youtube.com/watch?v=...), becomes an embedded player
  • Generic attributes, so {.note} after an element adds a class or attribute

Before and after​

Markdown:

## Order summary

Your order is **confirmed**.

| Item | Qty |
| ---- | --- |
| Pen | 2 |

HTML (line breaks shortened):

<h2 id="order-summary">Order summary</h2>
<p>Your order is <strong>confirmed</strong>.</p>
<table>
<thead>
<tr><th>Item</th><th>Qty</th></tr>
</thead>
<tbody>
<tr><td>Pen</td><td>2</td></tr>
</tbody>
</table>

With Use Bootstrap on, the table starts with <table class="table">.

Considerations​

  • Scripting license. The action needs the Standard.Scripting feature. If it isn't licensed, the action fails with an error.
  • Raw HTML passes through. HTML inside the markdown, including <script> tags, is copied to the output unchanged. Generic attributes can also add attributes such as onclick. If the markdown comes from users or an AI model, run Sanitize Html on the output before you show or store it.
  • Sanitizing removes links by default. Sanitize Html's Disable scripts option removes every href and src, so links and images in the converted markdown lose their targets. See What Disable scripts removes.
  • Display Message doesn't encode tokens. Display Message inserts the output token as HTML, which is what you want here, and why untrusted output needs sanitizing.
  • Dollar signs. Because math is on, text between two $ signs can be wrapped in a math <span>. Check prices and amounts in your output.
  • No styling is added. The output is plain HTML. Its look comes from your page's CSS, or from Bootstrap when Use Bootstrap is on and your page loads Bootstrap.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Convert an AI reply to HTML​

This action converts the Reply token, for example from Chat, and stores the HTML in ReplyHtml. It runs only when Reply has a value.

{
"Title": "Markdown to Html",
"ActionType": "Parsing.MarkdownToHtml",
"Description": "Convert the AI reply to HTML",
"Condition": "[Reply] != \"\"",
"Parameters": {
"MarkdownText": "[Reply]",
"UseBootstrap": true,
"OutputTokenName": "ReplyHtml"
}
}

2. Convert user notes and clean the result​

The first action converts the user's Notes to HTML. The second removes scripts, event attributes and risky tags before the HTML is shown or saved. Links in the notes lose their href because Disable scripts is on.

[
{
"Title": "Markdown to Html",
"ActionType": "Parsing.MarkdownToHtml",
"Description": "Convert the notes to HTML",
"Parameters": {
"MarkdownText": "[Notes]",
"UseBootstrap": false,
"OutputTokenName": "NotesHtml"
}
},
{
"Title": "Sanitize Html",
"ActionType": "Parsing.SanitizeHtml",
"Description": "Clean the converted notes",
"Parameters": {
"HtmlContent": "[NotesHtml]",
"ForceAnchorNoFollow": false,
"DisableScripts": true,
"IsAllowedMode": false,
"TagsList": [],
"RemovableTags": [
"style",
"iframe",
"object",
"embed",
"form"
],
"RemovableAttributes": [
"style"
],
"OutputTokenName": "NotesHtml"
}
}
]

Revised 09/27/2026