Example of undefined in Javascript Rich Text Editor Control

Format Painter

This demo demonstrates the Format Painter feature of the Rich Text Editor control. With Format Painter, copy and apply styles from one content to another.

More Details...

Format Painter

A Format Painter is a Rich Text Editor feature allowing users to quickly copy and paste formatting from one text to another. With a rich text editor, utilize the format painter as follows:

  • Select the text whose format you want to copy.
  • Click on the Format Painter button in the toolbar. It may look like a paintbrush icon.
  • The cursor will change to a paintbrush icon. Click and drag the cursor over the text you want to apply the copied format.
  • Release the mouse button to apply the format.

Using the format painter in a rich text editor can save you time when formatting a large document, You can quickly copy and apply formatting to multiple sections . It's a helpful tool for anyone who works with text editing regularly, such as writers, editors, and content creators.

Allowed Formats
Denied Formats

The Format Painter feature allows you to copy the formats and apply them to content without formatting thus saving time to reformat the content. Format painter can be accessed via the toolbar or the keyboard shortcuts. The sticky mode can be enabled by double-clicking the toolbar button, and it can be utilized to apply a format to multiple locations. Keyboard Shortcut ALT + SHIFT + C - Copy the selection format or current range. ALT + SHIFT + V - Paint the copied format. ESC - Remove the previously copied format and disable the sticky mode. The following settings are available to customize the format painter in the formatPainterSettings property. Fill the Allowed Formats input with selectors only whose format styles will be allowed. For example: span; strong; em; as the input allows only the span, strong, and em format styles to be copied. Fill the Denied Formats input with selectors only whose format styles will be explicitly prohibited. For example: span(important)[title]{background-color,color} as the input will remove only the important class, title attribute, color, and background-color of the span element. All other format styles will be copied. Injecting Modules: The Format Painter feature is segregated as an individual module. To use the format painter import and then inject it into the RichTextEditor. For example, inject the 'FormatPainter' module using RichTextEditor.Inject(HtmlEditor, Toolbar, QuickToolbar, FormatPainter ,Table, Link, Image, Audio, Video, PasteCleanup); to use the format painter feature.