This example demonstrates the paste cleanup feature of the Rich Text Editor control. Copy your content from MS Word or other website, and paste it within the editor to cleanup.
The Rich Text Editor allows to paste the HTML content from MS Word or other websites. The editor cleanup the pasted HTML content by considering the following items.
The following settings are available to cleanup the content in pasteCleanup settings property:
Format Option
drop down list for the paste content.
Prompt
option to invoke prompt dialog with paste options on pasting the content in editor.Plain Text
option to paste the content as plain text.Keep Format
option to keep the same format in the copied content.Clean Format
option to remove the style format in the copied content.denied tags
text box to ignore the tags when pasting HTML content. For example:
['a[!href]']
- paste the content by filtering anchor tags that don’t have the 'href' attribute.['a[href, target]']
- paste the content by filtering anchor tags that have the 'href' and 'target' attributes.denied attributes
to paste the content by filtering out these attributes from the content. For example:
['id', 'title']
- This will remove the attributes 'id' and 'title' from all tags.
allowed style properties
to paste the content by accepting these style attributes and removing other attributes. For example:
['color', 'margin']
- This will allow only the style properties 'color' and 'margin' in each pasted element.
Injecting Module
The previous features were built as modules to be included in your application. For example, inject the 'PasteCleanup'
module using Toolbar, Link, Image, QuickToolbar, Count, HtmlEditor, PasteCleanup
to use the paste cleanup feature.