prosemirror-trailing-node
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

prosemirror-trailing-node

"A trailing node plugin for the prosemirror editor.

Version Weekly Downloads Bundled size Typed Codebase MIT License


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
yarn add prosemirror-trailing-node prosemirror-view prosemirror-state prosemirror-keymap

# pnpm
pnpm add prosemirror-trailing-node prosemirror-view prosemirror-state prosemirror-keymap

# npm
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';

// Include the plugin in the created editor state.
const state = EditorState.create({
  schema,
  plugins: [trailingNode({ ignoredNodes: [], nodeName: 'paragraph' })],
});

Readme

Keywords

none

Package Sidebar

Install

npm i prosemirror-trailing-node

Weekly Downloads

1,701,509

Version

3.0.0

License

MIT

Unpacked Size

28.9 kB

Total Files

13

Last publish

Collaborators

  • ifiokjr