MarkdownBlock
Description
Renders Markdown text as sanitized HTML. The component uses the bundled marked and DOMPurify libraries (via the Markdown helper) so untrusted input is safe to display.
Usage
API reference
public class MarkdownBlock : ComponentBase<MarkdownBlock, HTMLElement>, ICanWrapA component that renders Markdown text as sanitized HTML. Uses the bundled marked and DOMPurify libraries via Markdown.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<MarkdownBlock, HTMLElement> → MarkdownBlock
- Implements
- ICanWrap
Constructors
| Name | Description |
|---|---|
| MarkdownBlock | Initializes a new instance of the MarkdownBlock class. |
Properties
| Name | Description |
|---|---|
| Text | Gets or sets the Markdown source text. Setting this re-renders the sanitized HTML. |
| HTML | Gets the rendered sanitized HTML (derived from Text). |
| CanWrap | Gets or sets whether the rendered Markdown can wrap. |
public string Text { get ; set ; }Gets or sets the Markdown source text. Setting this re-renders the sanitized HTML.
Methods
| Name | Description |
|---|---|
| Render | Renders the component. |