/
/
PasteCleanupRTE

This example demonstrates the paste cleanup feature of the RichTextEditor control. Paste your content in the editor after configuring the corresponding options and cleanup settings.

More Details...

Loading....
Description

The pasted content can be cleaned up using pasteCleanup settings. The following settings are available to clean up the content:

  • Select any option in Format Option drop down list for the paste content.
    • Select the Prompt option to invoke prompt dialog with paste options on pasting the content in editor.
    • Select the Plain Text option to paste the content as plain text.
    • Select the Keep Format option to keep the same format with copied content.
    • Select the Clean Format option to keep the same format with copied content.
  • Fill the 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.

  • Fill the 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.

  • Fill the 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 RichTextEditor.Inject (Toolbar, Link, Image, Count, HtmlEditor, PasteCleanup) to use the paste cleanup feature.