The Format Painter plugin allows a user to copy and paste formatting from one location to another, such as font style and size. The format painter is capable of working with a wide variety of formats such as inline and block formats and styles such as table styles.
The format painter retains the formatting after application making it possible to apply the same formatting multiple times by using the Ctrl+Alt+V keyboard shortcut.
liveDemo::format-painter[]
To add the Format Painter plugin to the editor, add formatpainter to the plugins option in the editor configuration.
For example:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
plugins: 'formatpainter',
toolbar: 'formatpainter'
});The format painter is accessed using either keyboard shortcuts or a toolbar button.
The format painter operates in two modes, one for retrieval and one for application of formatting. The usage of the keyboard is slightly different from the usage of the toolbar buttons.
Usage with toolbar button
Result: The formatting from the source content is applied to the goal content.
Usage with keyboard
-
Position the cursor at the source content to retrieve formatting.
-
Press the
Ctrl+Alt+Ckeys to read the formatting. -
Select the goal content to apply the formatting.
-
Press the
Ctrl+Alt+Vkeys to apply the formatting.
|
Tip
|
The format painter retains the formatting after application making it possible to apply the same formatting multiple times by using the Ctrl+Alt+V keyboard shortcut.
|
The format painter acts upon all formats registered in the editor. In addition to any standard formatting, it will treat lists as a block format whenever the lists plugin is made available.
The Format Painter plugin provides the following {productname} commands.