Clean unwanted elements and styles when copy paste from Microsoft Word
24 Jul 20192 minutes to read
While copy pasting content from MSWord document, the content will be processed in the paste action event.pasteCleanupSettings API can be used for removing unwanted elements.
This will convert an unformatted html element (MOS XML format) content to a proper html element.Table elements also will be converted with proper elements.
Options |
Description |
---|---|
|
List Conversion option convert the list elements into a proper format pasted from MSWord document to editor. |
|
Clean Css is used to clean the unwanted css in the elements pasted from MSWord document to editor |
|
Remove styles will remove all styles in the elements pasted from MSWord document to editor. |
|
Clean Elements is used to clean the unwanted elements pasted from MSWord document to editor. |
<ej:RTE ID="pastecleanupSample" ShowFooter="true" ShowHtmlSource="true" runat="server" MinWidth="200px" >
<RTEContent>
The Rich Text Editor (RTE) control is an easy to render in
client side. Customer easy to edit the contents and get the HTML content for
the displayed content. A rich text editor control provides users with a toolbar
that helps them to apply rich text formats to the text entered in the text
area.
</RTEContent>
<PasteCleanupSettings CleanCSS="true" CleanElements="true" ListConversion="true" RemoveStyles="true" />
</ej:RTE>
Pasted Content before Cleanup:
Pasted Content after Cleanup: