Class RadzenMarkdown
A component which renders markdown content.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenMarkdown : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Examples
<RadzenMarkdown>
Hello, world!
- This is a list item
- This is another list item
This is a blockquote </RadzenMarkdown>
Constructors
RadzenMarkdown()
A component which renders markdown content.
Declaration
public RadzenMarkdown()
Examples
<RadzenMarkdown>
Hello, world!
- This is a list item
- This is another list item
This is a blockquote </RadzenMarkdown>
Properties
AllowHtml
Gets or sets a value indicating whether to allow HTML content in the markdown. Certain dangerous HTML tags (script, style, object, iframe) and attributes are removed.
Set to true
by default.
Declaration
[Parameter]
public bool AllowHtml { get; set; }
Property Value
Type | Description |
---|---|
bool |
AllowedHtmlAttributes
Gets or sets a list of allowed HTML attributes. If set, only these attributes will be allowed in the markdown content. By default would use a list of safe HTML attributes.
Considered only if AllowHtml is set to true
.
Declaration
[Parameter]
public IEnumerable<string>? AllowedHtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
AllowedHtmlTags
Gets or sets a list of allowed HTML tags. If set, only these tags will be allowed in the markdown content. By default would use a list of safe HTML tags.
Considered only if AllowHtml is set to true
.
Declaration
[Parameter]
public IEnumerable<string>? AllowedHtmlTags { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
AutoLinkHeadingDepth
The maximum heading depth to create anchor links for. Set to 0
to disable auto-linking.
Declaration
[Parameter]
public int AutoLinkHeadingDepth { get; set; }
Property Value
Type | Description |
---|---|
int |
ChildContent
Gets or sets the markdown content.
Declaration
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment |
Text
Gets or sets the markdown content as a string. Overrides ChildContent if set.
Declaration
[Parameter]
public string? Text { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
BuildRenderTree(RenderTreeBuilder)
A component which renders markdown content.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
RenderTreeBuilder | __builder |
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
Type | Description |
---|---|
string |