Markdown ❺
Embed markdown content, including tables and more.
This feature brings basic Markdown capabilities into Webflow projects.
Goals
Support the embedding of simple, small chunks of markdown content directly in your Webflow page, including both;
"Chunk" format with multiple elements
Single-line format, where you only are using inline styles like bold, italics, highlight, strikethrough, etc.
Make them Embed compatible for simple editing
Support CMS use, within Rich Text field Embeds
Support Components, and component properties
Use Cases
Small table generation, in an easily-editable fashion
Small tables within blogs and other rich text content
Component property text formatting, such as bolding, italics, and highlighting within a property text string
Usage Notes
Rendering a block of Markdown
SA5 supports two approaches for Markdown content;
Use the
<markdown>
or<md>
element inside of any HTML Embed.Use a standard
<div>
with a custom attribute ofwfu-markdown
on it.
Here's an example of an H1 followed by a table;
<markdown>
# This is Markdown
| Day | Ponsonby Doctors | Viaduct Doctors |
| :--- | :--- | :--- |
| Mon 15th | 1pm - 5pm | 8am - 12pm |
| Tue 16th | closed | closed |
| Wed 17th | 9am- 5pm | 9am - 5pm |
| Thurs 18th | 1pm - 5pm | 8am - 12pm |
| Fri 19th | 1pm - 5pm | 8am - 12pm |
| Sat 20th | closed | 9pm - 1pm |
| Sun 21st | closed | closed |
</markdown>
And another example, using the <div>
approach;
<div wfu-markdown>
# This is more markdown
- List
- Indented
- And more
- Less Indented
1. Numbered
2. List
> Blockquote
> here.
</div>
Both approaches are widely-supported;
Works in standalone embed elements or as an embed within a rich text block
In rich text blocks, works with both static rich text blocks, and CMS-bound RTBs
Note that some users report that the <markdown>
approach may be ignored by Webflow's Site Search feature. If you need that content indexed, try the <div>
approach. The markdown content within it should be treated as plaintext for indexing purposes.
If you need to use Markdown extensively, and need server-side rendering to ensure 100% SEO support, Sygnal Hyperflow supports this. Contact us for details about a custom build.
Rendering an individual element as Markdown
In some cases, you may want only a small amount of Markdown rendered, for inline styling.
This is very useful for components, when you are binding to a plain text component property. Basic formatting like bold, underline, strikethrough and highlighting can be expressed as markdown and rendered properly into your page.
In this case, you have a two options that do not require embeds.
Create a DIV, heading, or other element, and assign the custom attribute of
wfu-markdown
to that element ( no value is needed ).Create a custom element of type
markdown
ormd
and put your content within it as text.
What Markdown Syntax is Supported?
SA5 supports;
All Markdown that Showdown supports natively
Plus table syntax using Showdown's table extensions
Plus a custom SA5 highlighting extension, which uses a popular
==
syntax that is widely recognized.
See the markdown
Other markdown-generated styling can be similarly targeted.
Italics
*Text*
<em>
Bold
**Text**
<strong>
Highlighting
==Text==
<mark>
Strikethrough
~~Text~~
<del>
Styling Your Markdown Content
Customize styling using custom CSS in an embed, like this;
<style>
[theme=default] mark {
background-color: lightblue;
}
</style>
This targets <mark>
elements which are generated with the ==highlighting==
markdown syntax.
Other markdown-generated styling can be similarly targeted.
Italics
*Text*
em
[theme=default] em
Bold
**Text**
strong
[theme=default] strong
Highlighting
==Text==
mark
[theme=default] mark
Strikethrough
~~Text~~
del
[theme=default] del
Themes
Markdown can be themed by specifying a theme attribute, e.g.;
<markdown theme="theme1">
...
</markdown>
See the Themes page for more details.
Getting Started
STEP 1 - Add the Library
First, add the library as detailed in Quick Start.
STEP 2 - Apply the custom attributes as desired
See above for details.
Technical Notes & Credits
Uses Showdown.js for the Markdown conversion
In your live site, the markdown elements are initially hidden until they are processed. Users may see an empty space briefly before the markdown conversion happens.
For very large tables ( which this is not suited for ) that may result in a content layout shift.
Last updated
Was this helpful?