New to Telerik UI for BlazorStart a free 30-day trial

A component that lets you configure paste cleanup for the TelerikEditor. Supports converting Microsoft Word lists, stripping tags and attributes (including Office-specific classes/styles), and removing HTML comments; updates the parent editor when settings change.

Definition

Constructors

C#
public EditorPasteSettings()

Properties

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.

C#
[Parameter]
public bool ConvertMsLists { get; set; }

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.

C#
[Parameter]
public bool RemoveAllAttributes { get; set; }

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.

C#
[Parameter]
public List<string> RemoveAttributes { get; set; }

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.

C#
[Parameter]
public bool RemoveHtmlComments { get; set; }

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.

C#
[Parameter]
public bool RemoveMsClasses { get; set; }

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.

C#
[Parameter]
public bool RemoveMsStyles { get; set; }

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.

C#
[Parameter]
public List<string> StripTags { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override Task OnInitializedAsync()
Returns:

Task

Overrides: ComponentBase.OnInitializedAsync()

C#
protected override Task OnParametersSetAsync()
Returns:

Task

Overrides: ComponentBase.OnParametersSetAsync()

C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: ComponentBase.SetParametersAsync(ParameterView)