Clean unwanted elements and styles when copy paste from Microsoft Word

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

listConversion



List Conversion option convert the list elements into a proper format pasted from MSWord document to editor.

cleanCSS



Clean CSS is used to clean the unwanted css in the elements pasted from MSWord document to editor

removeStyles



Remove styles will remove all styles in the elements pasted from MSWord document to editor.

cleanElements



Clean Elements is used to clean the unwanted elements pasted from MSWord document to editor.

  • html
  • <textarea id="rteSample">
         <p><b>Description:</b></p>
            <p>The Rich Text Editor (RTE) control is easy to render in the
            client side. Customers can easily 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. </p></textarea>
    
    /// <reference path="tsfiles/jquery.d.ts" />
    /// <reference path="tsfiles/ej.web.all.d.ts" />
    
    module RTEComponent {
        $(function () {
            var sample = new ej.RTE($("#rteSample"),{
               pasteCleanupSettings:{
                   listConversion:true,
                   cleanCSS:true,
                   removeStyles:true,
                   cleanElements:true
               }
        });
     });
    }

    Pasted Content before Cleanup:

    Pasted Content after Cleanup: