markdown

The markdown component renders Markdown content as sanitized HTML.

XML Element

markdown

Java Class

Markdown

Overview

Markdown content

Basics

The markdown component supports basic text formatting, lists, links, and other common Markdown features. The following example supplies the source text through the nested content element:

                <markdown>
                    <content>
                        <![CDATA[
# Markdown Sample

This is a sample text that showcases the usage of a Markdown component in Jmix.

## Formatting:
Here is some formatting:

- **Bold text:** Use the `**` to make text **bold**.
- *Italic text:* Use the `*` tag to make text *italic*.

## Lists:
Here are some examples of lists:

### Ordered List:
1. First item
2. Second item
3. Third item

### Unordered List:
- Fruits
  - Apples 🍎
  - Bananas 🍌
  - Oranges 🍊
- Vegetables
  - Carrots
  - Broccoli

## Hyperlinks:
Hyperlinks can be added using the `[text](link)` construction:

[Visit jmix.io](https://www.jmix.io)
                        ]]>
                    </content>
                </markdown>
Avoid leading spaces at the beginning of lines inside the content element. Markdown syntax is indentation-sensitive, so unexpected spaces can change the rendering of headings, lists, and code blocks.

For details about Markdown syntax, see the Markdown Guide.

Content from a Message Bundle

Use the content attribute when the Markdown source is stored in a message bundle. Prefix the message key with msg:// so that the component resolves the localized value:

XML
<markdown content="msg://markdown.content"/>
Properties
com.company.onboarding.view.component.markdown/markdown.content=### Welcome to Our App\n\
This is a **markdown** component demonstrating:\n\
- Basic formatting\n\
- List items\n\
- [Links](https://example.com)

Attributes

The following attributes are specific to markdown:

Name Description Default

content

Sets the Markdown source, either directly or from a message bundle. See Content from a Message Bundle.

The following shared attributes are supported by markdown:

Handlers

The following shared handlers are supported by markdown:

Elements

A markdown component can include a content element containing the Markdown source.