@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor EditorMode="EditorMode.Markdown" Height="340px" Placeholder="Type Something">
<RichTextEditorMarkdownOptions ListSyntax="@ListSyntax" />
In Rich Text Editor , you click the toolbar buttons to format the words and the changes are visible immediately.
Markdown is not like that. When you format the word in Markdown format, you need to add Markdown syntax to the word to indicate which words
and phrases should look different from each other.
Rich Text Editor supports markdown editing when the editorMode set as **markdown** and using both *keyboard interaction* and *toolbar action*,
you can apply the formatting to text.
We can add our own custom formation syntax for the Markdown formation, [sample link](https://blazor.syncfusion.com/home/).
The third-party library <b>Marked</b> is used in this sample to convert markdown into HTML content.
Markdown Table Format
|Heading 1|Heading 2|
|---------|---------|
|Col A1|Col A2|
|Col B1|Col B2|
</SfRichTextEditor>
@code {
private Dictionary<string, string> ListSyntax { get; set; } = new Dictionary<string, string>(){
{ "OL", "1., 2., 3." }
};
}
|
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor EditorMode="EditorMode.Markdown" Height="340px" Placeholder="Type Something">
<RichTextEditorToolbarSettings Items="@Tools" />
In Rich Text Editor , you click the toolbar buttons to format the words and the changes are visible immediately.
Markdown is not like that. When you format the word in Markdown format, you need to add Markdown syntax to the word to indicate which words
and phrases should look different from each other.
Rich Text Editor supports markdown editing when the editorMode set as **markdown** and using both *keyboard interaction* and *toolbar action*,
you can apply the formatting to text.
We can add our own custom formation syntax for the Markdown formation, [sample link](https://blazor.syncfusion.com/home/).
The third-party library <b>Marked</b> is used in this sample to convert markdown into HTML content.
Markdown Table Format
|Heading 1|Heading 2|
|---------|---------|
|Col A1|Col A2|
|Col B1|Col B2|
</SfRichTextEditor>
@code {
private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.Bold },
new ToolbarItemModel() { Command = ToolbarCommand.Italic },
new ToolbarItemModel() { Command = ToolbarCommand.StrikeThrough },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.Formats },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.OrderedList },
new ToolbarItemModel() { Command = ToolbarCommand.UnorderedList },
new ToolbarItemModel() { Command = ToolbarCommand.CreateLink },
new ToolbarItemModel() { Command = ToolbarCommand.Image },
new ToolbarItemModel() { Command = ToolbarCommand.FullScreen },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.Undo },
new ToolbarItemModel() { Command = ToolbarCommand.Redo }
};
}
|