Skip to content

Commit 7aaa595

Browse files
Merge branch '979389-block-editor' of https://github.com/syncfusion-content/blazor-docs into development
2 parents b4870a2 + bab2166 commit 7aaa595

12 files changed

+175
-2
lines changed

blazor-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4157,6 +4157,7 @@
41574157
<li><a href="/blazor/rich-text-editor/tools/table-manipulation">Table manipulation</a></li>
41584158
<li><a href="/blazor/rich-text-editor/tools/code-block">Code Block</a></li>
41594159
<li> <a href="/blazor/rich-text-editor/paste-cleanup">Paste Clean-up</a></li>
4160+
<li> <a href="/blazor/rich-text-editor/clipboard-cleanup">Clipboard Clean-up</a></li>
41604161
<li> <a href="/blazor/rich-text-editor/enter-key">Enter Key Configuration</a></li>
41614162
<li> <a href="/blazor/rich-text-editor/undo-redo-manager">Undo Redo Manager</a></li>
41624163
<li> <a href="/blazor/rich-text-editor/import-and-export">Import/Export</a></li>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
layout: post
3+
title: Clipboard Clean-up in Blazor Rich Text Editor | Syncfusion
4+
description: Checkout and learn here all about Clipboard Clean-up in Syncfusion Blazor Rich Text Editor component and more.
5+
platform: Blazor
6+
control: RichTextEditor
7+
documentation: ug
8+
---
9+
10+
# Clipboard Clean-up in Blazor Rich Text Editor
11+
12+
The Rich Text Editor now provides automatic cleanup of clipboard content during copy (`Ctrl + C`) and cut (`Ctrl + X`) operations. When this feature is enabled, unwanted inline styles are removed while preserving important structural elements such as tables, lists, and images. This feature is enabled by default through [EnableClipboardCleanup](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_EnableClipboardCleanup) property.
13+
14+
It can be verified by following the below steps:
15+
16+
- Copy or cut content within the Rich Text Editor.
17+
- Paste the content back into the editor.
18+
- Observe that unnecessary inline styles are removed while essential elements such as tables, lists, and images remain intact.
19+
20+
By default, `EnableClipboardCleanup` is set to `true`. Check with the below demonstration:
21+
22+
{% tabs %}
23+
{% highlight razor %}
24+
25+
{% include_relative code-snippet/clipboard-cleanup-default.razor %}
26+
27+
{% endhighlight %}
28+
{% endtabs %}
29+
30+
![Blazor RichTextEditor with default clipboard cleanup](./images/blazor-richtexteditor-clipboard-cleanup-default.png)
31+
32+
When set to `false`, the browser’s default copy and cut behavior applies. Check with the below demonstration:
33+
34+
{% tabs %}
35+
{% highlight razor %}
36+
37+
{% include_relative code-snippet/clipboard-cleanup-custom.razor %}
38+
39+
{% endhighlight %}
40+
{% endtabs %}
41+
42+
![Blazor RichTextEditor with clipboard cleanup disabled](./images/blazor-richtexteditor-clipboard-cleanup-custom.png)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@using Syncfusion.Blazor.RichTextEditor
2+
3+
<SfRichTextEditor EnableClipboardCleanup="false">
4+
<h3>Clipboard Cleanup Disabled</h3>
5+
<p>The Rich Text Editor uses the browser’s default copy and cut behavior when clipboard cleanup is disabled.</p>
6+
<p><b>Key Points:</b></p>
7+
<ul>
8+
<li>No cleanup is applied; original styles remain intact.</li>
9+
<li>Content is copied exactly as it appears in the editor.</li>
10+
</ul>
11+
</SfRichTextEditor>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@using Syncfusion.Blazor.RichTextEditor
2+
3+
<SfRichTextEditor>
4+
<h3>Clipboard Cleanup – Default Behavior</h3>
5+
<p>The Rich Text Editor automatically cleans up clipboard content during copy and cut operations to ensure clean formatting.</p>
6+
<p><b>Key Features:</b></p>
7+
<ul>
8+
<li>Removes unwanted inline styles from copied or cut content.</li>
9+
<li>Preserves essential elements like tables, lists, and images.</li>
10+
</ul>
11+
</SfRichTextEditor>
30.1 KB
Loading
5.7 KB
Loading
68.4 KB
Loading
-1.4 MB
Loading
-4.26 MB
Loading
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@using Syncfusion.Blazor.RichTextEditor;
2+
<SfRichTextEditor>
3+
<RichTextEditorToolbarSettings Items="@Items" />
4+
<RichTextEditorLineHeight Items="@LineHeightItems" Default="Default"></RichTextEditorLineHeight>
5+
<p>The Rich Text Editor allows users to apply line-height (line-spacing) to elements like paragraphs, lists, headings, and table cells. You can set line height using a dedicated dropdown in the toolbar, and it is applied as inline style to the selected blocks. This feature makes text easier to read and gives better control over content layout.</p>
6+
<p><b> Key features:</b></p>
7+
<ul>
8+
<li><p>Provides a <b>Line Height</b> dropdown in the toolbar for easy access.</p></li>
9+
<li><p>Supports applying line-height to paragraphs, headings, lists, and table cells.</p></li>
10+
<li><p>Applies line-height as inline styles for consistent and precise text rendering.</p></li>
11+
<li><p>Ensures consistent appearance across devices and print layouts.</p></li>
12+
<li><p>Improves text readability and overall document aesthetics.</p></li>
13+
</ul>
14+
</SfRichTextEditor>
15+
@code {
16+
private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
17+
{
18+
new ToolbarItemModel() { Command = ToolbarCommand.LineHeight },
19+
};
20+
private List<DropDownItemModel> LineHeightItems = new()
21+
{
22+
new DropDownItemModel { Text = "Default", Value = "" },
23+
new DropDownItemModel { Text = "1", Value = "1" },
24+
new DropDownItemModel { Text = "1.15", Value = "1.15" },
25+
new DropDownItemModel { Text = "1.5", Value = "1.5" },
26+
new DropDownItemModel { Text = "2", Value = "2" },
27+
new DropDownItemModel { Text = "2.5", Value = "2.5" },
28+
new DropDownItemModel { Text = "3", Value = "3" }
29+
};
30+
}

0 commit comments

Comments
 (0)