Class RichTextEditorPasteCleanupSettings
The class is used to configure paste related settings in the Rich Text Editor.
Inheritance
Namespace: Syncfusion.Blazor.RichTextEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class RichTextEditorPasteCleanupSettings : OwningComponentBase
Constructors
RichTextEditorPasteCleanupSettings()
Declaration
public RichTextEditorPasteCleanupSettings()
Properties
AllowedStyleProperties
Gets or sets the list of allowed CSS style attributes when pasting into the editor.
Declaration
public string[] AllowedStyleProperties { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | An array of strings representing the allowed CSS style properties. |
Remarks
Only the specified CSS style attributes are preserved, others will be removed from the pasted tags.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorPasteCleanupSettings AllowedStyleProperties="@AllowedStyles"/>
</SfRichTextEditor>
@code {
private string[] AllowedStyles = new string[] { "color", "font-size" };
}
DeniedAttributes
Gets or sets the list of CSS style attributes that are removed with their content when pasting text into the editor.
Declaration
public string[] DeniedAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | An array of strings representing the CSS style attributes to be denied. |
Remarks
Only the specified attributes will be restricted when pasting text into the editor.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorPasteCleanupSettings DeniedAttributes="@DeniedList"/>
</SfRichTextEditor>
@code {
private string[] DeniedList = new string[] { "class", "title", "id" };
}
DeniedTags
Gets or sets the list of HTML tags that are removed with their content when pasting text into the editor.
Declaration
public string[] DeniedTags { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | An array of strings specifying the HTML tags to be denied. |
Remarks
Only the specified HTML tags will be restricted when pasting content into the editor.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorPasteCleanupSettings DeniedTags="@DeniedTagList"/>
</SfRichTextEditor>
@code {
private string[] DeniedTagList = new string[] { "a", "a[!href]" };
}
KeepFormat
Gets or sets whether to retain the formatting of the copied content when pasting into the editor.
Declaration
public bool KeepFormat { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value; |
Remarks
If true
, preserves the format of copied content during pasting.
PlainText
Gets or sets whether to convert the pasted content into plain text, thereby removing all formatting.
Declaration
public bool PlainText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value; |
Remarks
If true
, formats are stripped from the content, leaving only plain text.
Prompt
Gets or sets whether to show a modal dialog to decide whether to keep or clean the formatting in the copied content.
Declaration
public bool Prompt { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value; |
Remarks
If true
, displays a dialog for user choice on keeping or cleaning formatting in pasted content.
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. |