Writing helpers
Writing helpers support people while they write: they count characters, find and replace text, show hidden characters, hint at what to write, set typographic characters, and undo changes.
Character count
Count characters and words, and limit their number.
Open source
Find and replace
Search, highlight, navigate, and replace text in your editor.
Open source
Invisible characters
Show spaces, line breaks, and paragraph ends.
Open source
Placeholder
Show a placeholder text in empty documents or nodes.
Open source
Typography
Replace plain characters with typographic ones, such as curly quotes and dashes, as you type.
Open source
Undo and redo
Undo and redo changes in the editor.
Open source
When you use them
- Length limits. Character count counts characters and words, and can limit the number of characters.
- Searching. Find and replace searches the document, highlights matches, and replaces them, with options for match case, whole words, and regular expressions.
- Hidden characters. Invisible characters shows spaces, hard breaks, and paragraph ends.
- Hints. Placeholder shows a short hint in an empty editor or an empty node.
- Typography. Typography replaces text patterns as you type, for example two dashes with an em dash or three dots with an ellipsis.
- Mistakes. Undo and redo reverts changes and reapplies undone ones.
How they work
- They are extensions. They don't add nodes or marks to the document. Extensions
- Undo and redo comes with the StarterKit. It is part of the StarterKit; the others you add yourself.
- Not in collaborative editors. Collaboration has its own undo and redo, so turn off Undo and redo there, in the StarterKit with
undoRedo: false. - You build the UI. Find and replace is headless, and Character count gives its numbers through
characters()andwords(). Find and replace UI guide
Related
- Document helpers work on the document as a whole.
- Real-time collaboration lets several people write at the same time.