Class BlockEditorPasteCleanup
Gets or sets the settings related to paste operations in the editor.
Inherited Members
Namespace: Syncfusion.Blazor.BlockEditor
Assembly: Syncfusion.Blazor.BlockEditor.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
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: |
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 |
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 |
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
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |