Shows Markdown, such as release notes or a chat reply: turned into HTML on the server, sanitized, then styled as Prose.
Release notes
Set Text to the Markdown. It's CommonMark, with GitHub's tables, task lists, strikethrough and links from bare URLs. Under the page's own title, set TopHeading to 2.
Static
Preview
Version 2.4
Invoices can now be paid in any currency your account accepts. See the currency guide for the list.
Changes
| Area | Change | Ticket |
|---|---|---|
| Billing | Refunds round to the cent | 1182 |
| Exports | CSV files open in Excel without a prompt | 1207 |
| Search | 1213 |
Before you upgrade
- Back up the
invoicestable - Set
Billing:Currenciesin appsettings.json:
{ "Billing": { "Currencies": ["USD", "EUR", "GBP"] } }
Questions? Write to [email protected].
Code
@* A changelog entry kept in Markdown, as a repository's release notes are. *@
<Markdown Text="notes" TopHeading="2" MaxWidth="Length.Prose" Grow />Add this example to a page with the izzy CLI:
izzy add component Markdown --at <file>:<line>The Markdown becomes HTML on the server and is sanitized as RichText sanitizes HTML, so HTML written in it can't run script. A fenced code block's language is highlighted.
To turn Markdown into safe HTML yourself, call RichTextMarkdown.ToHtml.
Details
RichTextMarkdown reads Text as CommonMark, with GitHub's tables, task lists, strikethrough and links from bare URLs, and RichTextSanitizer cleans the result, so HTML written in the Markdown can't run script on the page. A fenced code block with a language is highlighted on the server, as Code is. For saved HTML, use RichText.
Mode support
| Feature | Static | Interactive |
|---|---|---|
| Everything | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Accessibility
- Heading levels, alt text and link text come from the Markdown. When the page has its own heading 1 above the text, set
TopHeadingto 2 so the text's headings sit under it. - Links are underlined, not marked by color alone.
Parameters
| Prop | Type | Default |
|---|---|---|
TextThe Markdown to show. | string? | |
TopHeadingThe highest heading level shown, 1 to 6: higher headings move down to it. | int | 1 |
AllowDataImagesKeep images whose source is a data: URL of a PNG, JPEG, GIF, WebP or AVIF image. | bool | false |
SizeText size. | ProseSize | ProseSize.Md |
AsThe element to render: div on a Box; components built on it set their own (List a ul, Section a section). | string | "div" |
ChildContentThe content. | RenderFragment? |
Plus 27 surface props, 17 item props and 4 common props.
Full APISee also
- RichText: displays HTML from an editor or a CMS safely in the page.
RichTextMarkdown