Docs › Text and paragraphs
Clear and copy formatting
Clear formatting, the format painter, and changing letter case.
Strip formatting from text that came from somewhere else, or copy the look of one spot onto another.
Try it
Put the caret in the big red bold words, press the format painter, then select another part of this sentence.
Select hello world and try the case menu.
Code for this demo
createEditor('#editor', {
toolbar: 'bold color | clearFormat formatPainter caseChange',
});Clear formatting (clearFormat)
Removes bold, italic, underline, strikethrough, sub/superscript, inline code, text and highlight colors, font and size from the selection. Shortcut Ctrl+\. Links and paragraph formats such as headings, alignment and lists stay; code blocks are left alone. It needs a selection.
Format painter (formatPainter)
- Put the caret in the text whose look you want and press
formatPainter. A short message confirms the copy. - Drag over the target text, or select it with Shift+arrow keys: its formatting is cleared and the copied one applied.
- Copied: bold, italic, underline, strikethrough, sub/superscript, text color, highlight, size and font. Paragraph formats like alignment or line height are not.
- It applies once. Press the button again or Esc to cancel before applying.
Letter case (caseChange)
Turns the selected text into UPPERCASE, lowercase or Title Case.
Presets
board(default):clearFormatat the end of the first row,formatPainterunder ⋯ more, nocaseChangefull: all three under more- The selection toolbar has clear formatting too.
Text pasted from Word or HWP is already cleaned on paste. For plain text, paste with Ctrl+Shift+V (Paste cleanup).
API
editor.exec('clearFormat');
editor.exec('caseChange', 'upper'); // upper | lower | title
editor.exec('formatPainter');Options
| Name | Type | Default | Description |
|---|---|---|---|
clearFormat | toolbar item | — | Clear formatting from the selection |
formatPainter | toolbar item | — | Copy formatting and paint it once |
caseChange | toolbar item | — | Letter case menu |