menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RichTextEditorMarkdownOptions - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RichTextEditorMarkdownOptions

    A class used to configure Markdown properties in the SfRichTextEditor. This class allows customization of the syntax used for Markdown editing within the editor.

    Inheritance
    System.Object
    RichTextEditorMarkdownOptions
    Namespace: Syncfusion.Blazor.RichTextEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class RichTextEditorMarkdownOptions : OwningComponentBase

    Constructors

    RichTextEditorMarkdownOptions()

    Declaration
    public RichTextEditorMarkdownOptions()

    Properties

    FormatSyntax

    Gets or sets the Markdown syntax used for heading formats in the SfRichTextEditor.

    Declaration
    public Dictionary<string, string> FormatSyntax { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    A System.Collections.Generic.Dictionary<, > where the key is the heading level (e.g., "h1") and the value is the syntax string.

    Examples

    In the following code example, the custom syntax + is added for heading1 format.

    @using Syncfusion.Blazor.RichTextEditor;
    <SfRichTextEditor EditorMode="EditorMode.Markdown">
        <RichTextEditorMarkdownOptions FormatSyntax="@FormatSyntax" />
    </SfRichTextEditor>
    @code {
        private Dictionary<string, string> FormatSyntax { get; set; } = new Dictionary<string, string>()
        {
            { "h1", "+ " }
        };
    }

    ListSyntax

    Gets or sets the Markdown syntax used for list formats in the editor.

    Declaration
    public Dictionary<string, string> ListSyntax { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    A System.Collections.Generic.Dictionary<, > where the key is the list type (e.g., "OL", "UL") and the value is the syntax string.

    Examples

    In the following code example, the custom syntax + is added for the unordered list format and 1. for the ordered list format.

    @using Syncfusion.Blazor.RichTextEditor;
    <SfRichTextEditor EditorMode="EditorMode.Markdown">
        <RichTextEditorMarkdownOptions ListSyntax="@ListSyntax"/>
    </SfRichTextEditor>
    @code {
        private Dictionary<string, string> ListSyntax { get; set; } = new Dictionary<string, string>()
        {
            { "OL", "1. " },
            { "UL", "+ " }
        };
    }

    SelectionSyntax

    Gets or sets the Markdown syntax used for the selection formats in the editor.

    Declaration
    public Dictionary<string, string> SelectionSyntax { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    A System.Collections.Generic.Dictionary<, > where the key is the text effect (e.g., "Bold", "Italic") and the value is the syntax string.

    Examples

    In the following code example, the custom syntax __ is added for bold selected text and _ for applying the italic style.

    @using Syncfusion.Blazor.RichTextEditor;
    <SfRichTextEditor EditorMode="EditorMode.Markdown">
        <RichTextEditorMarkdownOptions SelectionSyntax="@SelectionSyntax"/>
    </SfRichTextEditor>
    @code {
        private Dictionary<string, string> SelectionSyntax { get; set; } = new Dictionary<string, string>()
        {
            { "Bold", "__" },
            { "Italic", "_" }
        };
    }

    Methods

    Dispose(Boolean)

    Dispose unmanaged resources in the Syncfusion Blazor component.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Boolean value to dispose the object.

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    OnParametersSetAsync()

    Method invoked when the component has received parameters from its parent.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved