Class
EditorPasteSettings

The class for the paste settings of the Editor component.

Definition

Constructors

EditorPasteSettings()

Declaration

cs-api-definition
public EditorPasteSettings()

Properties

ConvertMsLists

Controls whether Microsoft Word list formatting is automatically converted to proper HTML list elements. When enabled, pasted Word lists become standard HTML ul/ol elements for consistent rendering. Improves compatibility and ensures list formatting works correctly across different browsers. Recommended to keep enabled for better content consistency and accessibility. Default value is true.

Declaration

cs-api-definition
[Parameter]
public bool ConvertMsLists { get; set; }

Property Value

bool

RemoveAllAttributes

Controls whether all HTML attributes are stripped from pasted content for maximum cleanliness. When enabled, removes all attributes including classes, styles, IDs, and other properties from HTML elements. Takes precedence over RemoveAttributes, RemoveMsClasses, and RemoveMsStyles. Use for scenarios requiring clean, attribute-free HTML output or high security requirements. Default value is false.

Declaration

cs-api-definition
[Parameter]
public bool RemoveAllAttributes { get; set; }

Property Value

bool

RemoveAttributes

Specifies specific HTML attributes to be removed from pasted content for selective cleaning. Allows fine-grained control over which attributes are preserved and which are removed. Example: new List<string> { "id", "onclick", "data-custom" } removes specific unwanted attributes. Ignored when RemoveAllAttributes is enabled. Use for targeted content sanitization.

Declaration

cs-api-definition
[Parameter]
public List<string> RemoveAttributes { get; set; }

Property Value

List<string>

RemoveHtmlComments

Controls whether HTML comments are removed from pasted content for cleaner output. When enabled, removes developer comments and other HTML comment blocks that aren't needed in the editor. Helps reduce content size and removes potentially sensitive information from pasted content. Recommended for production environments where content cleanliness is important. Default value is false.

Declaration

cs-api-definition
[Parameter]
public bool RemoveHtmlComments { get; set; }

Property Value

bool

RemoveMsClasses

Controls whether Microsoft Office CSS classes are automatically removed from pasted content. When enabled, removes classes starting with "Mso" that are generated by Microsoft Word and other Office applications. Improves content cleanliness and prevents Office-specific styling from affecting editor appearance. Recommended to keep enabled for consistent formatting across different content sources. Default value is true.

Declaration

cs-api-definition
[Parameter]
public bool RemoveMsClasses { get; set; }

Property Value

bool

RemoveMsStyles

Controls whether Microsoft Office inline styles are automatically removed from pasted content. When enabled, removes style attributes starting with "mso" that are generated by Microsoft Word and other Office applications. Improves content cleanliness and prevents Office-specific styling from conflicting with editor styles. Recommended to keep enabled for consistent formatting and better visual integration. Default value is true.

Declaration

cs-api-definition
[Parameter]
public bool RemoveMsStyles { get; set; }

Property Value

bool

StripTags

Specifies HTML tags to be completely removed from pasted content including their content. Use this to block unwanted elements like scripts, forms, or other tags that shouldn't appear in the editor. Example: new List<string> { "script", "form", "iframe" } removes security risks and unsupported elements. Works together with RemoveAllAttributes for comprehensive content cleaning.

Declaration

cs-api-definition
[Parameter]
public List<string> StripTags { get; set; }

Property Value

List<string>

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnInitializedAsync()

Declaration

cs-api-definition
protected override Task OnInitializedAsync()

Returns

Task

Overrides ComponentBase.OnInitializedAsync()

OnParametersSetAsync()

Declaration

cs-api-definition
protected override Task OnParametersSetAsync()

Returns

Task

Overrides ComponentBase.OnParametersSetAsync()

SetParametersAsync(ParameterView)

Declaration

cs-api-definition
public override Task SetParametersAsync(ParameterView parameters)

Parameters

parameters

ParameterView

Returns

Task

Overrides ComponentBase.SetParametersAsync(ParameterView)