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.

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() and words(). Find and replace UI guide