alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class BlockEditorPasteCleanup

    Gets or sets the settings related to paste operations in the editor.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    BlockEditorPasteCleanup
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.BlockEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class BlockEditorPasteCleanup : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    This can be used to strip styles, sanitize pasted HTML, or control allowed elements.

    Constructors

    BlockEditorPasteCleanup()

    Declaration
    public BlockEditorPasteCleanup()

    Properties

    AllowedStyles

    Specifies the list of allowed CSS styles when pasting content.

    Declaration
    [Parameter]
    public string[] AllowedStyles { get; set; }
    Property Value
    Type Description
    string[]

    A string array containing the names of CSS properties to retain from pasted content.

    Remarks

    Only the styles listed in this property will be preserved; all others will be removed. For example: "color", "font-weight".

    Examples
    AllowedStyles = new[] { "color", "font-weight", "font-style" };

    DeniedAttributes

    Specifies the list of denied attributes that should be removed from pasted content.

    Declaration
    [Parameter]
    public string[] DeniedAttributes { get; set; }
    Property Value
    Type Description
    string[]

    A string array of HTML attribute names that should be stripped. Examples include "style", "onclick".

    Remarks

    Attributes listed here will be removed from all elements during paste cleanup.

    Examples
    DeniedAttributes = new[] { "style", "onclick", "onmouseover" };

    DeniedTags

    Specifies the list of denied HTML tags that should be removed when pasting content.

    Declaration
    [Parameter]
    public string[] DeniedTags { get; set; }
    Property Value
    Type Description
    string[]

    A string array of HTML tag names to be removed during paste processing. Example: "script", "iframe".

    Remarks

    Any tag specified will be stripped entirely from the pasted content.

    Examples
    DeniedTags = new[] { "script", "iframe", "style" };

    KeepFormat

    Specifies whether to retain formatting from the pasted content.

    Declaration
    [Parameter]
    public bool KeepFormat { get; set; }
    Property Value
    Type Description
    bool

    A boolean value indicating whether styles like bold, italic, or headings are preserved. The default is true.

    Remarks

    If both PlainText and KeepFormat are set to true, PlainText takes precedence and formatting will be stripped.

    PlainText

    Specifies whether the pasted content should be plain text.

    Declaration
    [Parameter]
    public bool PlainText { get; set; }
    Property Value
    Type Description
    bool

    A boolean value indicating if all formatting should be removed from pasted content. The default is false.

    Remarks

    When set to true, all HTML tags and styles will be stripped, resulting in raw text only.

    Methods

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    OwningComponentBase.Dispose(bool)

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved