Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

3.1 KB
Raw Blame

description: Markdown Embed converts Markdown to HTML and enables styling it.

🪜 Markdown Embed

Markdown Embed card in the Components panel Data group

Why Markdown Embed is needed

Some APIs (or users) provide rich text in Markdown format, which can't be rendered in the web browser. Markdown Embed converts Markdown to HTML and enables applying styles to the various tags contained within HTML.

How to use Markdown Embed

Markdown Embed is located in Components > Data.

1. Add Markdown

Once added to the canvas, the right panel will show a Code field. You can either add Markdown directly to it or, more commonly, bind Markdown to it from a Resource.

Markdown bound to Markdown Embed component

CMS data bound to Markdown Embed Code

2. Style

In the Navigator, Markdown Embed has various HTML tags nested. Expand Markdown Embed, and you’ll see tags such as Heading 1, Link, Image, and much more.

Markdown Embed List styled

List selected and styled

Styles applied to each of these tags will apply to all occurrences of that tag within the Markdown Embed. For example, if you apply a border on the Image tag, then all images contained within the HTML will have a border.

GitHub-style alerts

Use GitHub-style alerts to call attention to notes, tips, important information, warnings, and cautions:

> [!NOTE]
> Add helpful context here.

> [!WARNING]
> Explain what readers should be careful about.

Write the alert type in uppercase at the start of a blockquote. Markdown Embed supports NOTE, TIP, IMPORTANT, WARNING, and CAUTION. You can use links, lists, code, and other Markdown inside an alert.

Select Alert to style every alert, or a type-specific descendant such as Warning alert to style one alert type. Markdown Embed renders the same data-state values as the standalone Alert component.

Image handling

Webstudio optimizes images contained in Markdown with the same responsive image pipeline as the Image component. It generates the appropriate srcset and sizes attributes and lazy-loads images by default.

Data URL images are served as-is without optimization.

Similar components

{% content-ref url="html-embed.md" %} html-embed.md {% endcontent-ref %}

{% content-ref url="content-embed.md" %} content-embed.md {% endcontent-ref %}

Related