Every extension
clearFormatting
Back to plain text: every mark off the selection, every block a paragraph.
The toolbar button labelled with a crossed-out T. One command rather than a call per mark, so the host does not have to know which marks the editor was built with — and one undo step, because that is what the person pressing it expects to get back.
Adding it
import { createEditor, document, paragraph, text, clearFormatting } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, clearFormatting],
element: document.querySelector('#editor'),
})
There is no separate package · clearFormatting is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.unsetAllMarks() -
editor.commands.clearBlocks() -
editor.commands.clearFormatting()
Keys
- Mod-\ ·
clearFormatting