This demo demonstrates the Format Painter feature of the Rich Text Editor component. With Format Painter, copy and apply styles from one content to another.
The Format Painter feature allows you to copy the formats and apply them to content that has no formatting thus saving the time to reformat the content.
Keyboard Shortcut:
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 you can import and then inject it into the RichTextEditor.
To use Rich Text Editor feature, we need to inject 'FormatPainter'
module using inject component and then adding the modules in the services prop.
[HtmlEditor, Toolbar, FormatPainter, QuickToolbar, Image, Link, Table, PasteCleanup]