Tags
There are two tags that you can use to add Markdown to your emails:emails/example.html
Attributes
Use attributes if you need the element wrapping your Markdown to be preserved:emails/example.html
Wrapping tag
Use thetag attribute to specify a tag name to wrap your Markdown with:
emails/example.html
Importing files
Already have some Markdown in a file? Simply include it:emails/example.html
<p> tags, use the inline attribute:
emails/example.html
GFM
GitHub Flavored Markdown is supported and the Tables and Strikethrough extensions are enabled by default.Tables
Create tables with pipes| and hyphens -. Use hyphens to define each column’s header, and pipes to separate each column.
emails/example.html
Strikethrough
Use two tildes~~ to ~~strikethrough~~Configuration
You may configure how Markdown is rendered through themarkdown config object:
config.js
Front Matter
You may override the global Markdown config from your Template’s Front Matter.emails/example.html
Disabling
Disable the markdown Transformer by setting it tofalse:
config.js
Plugins
There are over 300 plugins formarkdown-it available on NPM! To use a plugin, npm install it first and then add it to config.js.
For example, imagine we installed markdown-it-emoji:
config.js
emails/example.html
Escaping variables
If you’re using expressions to render markdown from a variable that you have defined in your config like this:config.js
emails/example.html
> will be output as > and the blockquote will be rendered as a paragraph.
API
You may use the Markdown Transformer in your application.app.js
manual option and then wrap the Markdown content in <md> tags:
app.js