Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RichTextEditorMarkdownOptions

    Show / Hide Table of Contents

    Class RichTextEditorMarkdownOptions

    A class used for configuring the Markdown properties in SfRichTextEditor.

    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 that can be used for the 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>
    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 that can be used for the list in editor.

    Declaration
    public Dictionary<string, string> ListSyntax { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.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 that can be used for the selection in editor.

    Declaration
    public Dictionary<string, string> SelectionSyntax { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.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 - 2023 Syncfusion Inc. All Rights Reserved