prosemirror-trailing-node
"A trailing node plugin for the prosemirror editor.

The problem
You want your editor to always have allow exiting the current non-empty node.
This solution
prosemirror-trailing-node
allows you to set a default node that will be appended to the end of the document.
Installation
yarn add prosemirror-trailing-node prosemirror-view prosemirror-state prosemirror-keymap
pnpm add prosemirror-trailing-node prosemirror-view prosemirror-state prosemirror-keymap
npm install prosemirror-trailing-node prosemirror-view prosemirror-state prosemirror-keymap
The installation requires the installation of the peer dependencies prosemirror-view
, prosemirror-state
and prosemirror-model
to avoid version clashes.
Getting Started
import { schema } from 'prosemirror-schema-basic';
import { trailingNode } from 'prosemirror-trailing-node';
const state = EditorState.create({
schema,
plugins: [trailingNode({ ignoredNodes: [], nodeName: 'paragraph' })],
});