prosemirror-paste-rules
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

prosemirror-paste-rules

Better handling of pasted content in the editor.

Version Weekly Downloads Bundled size Typed Codebase MIT License


The problem

You want to automatically transform pasted content within your editor into nodes marks, or different text.

This solution

prosemirror-paste-rules allows the transformation of plain text pasted content into marks and nodes.


Installation

# yarn
yarn add prosemirror-paste-rules prosemirror-view prosemirror-state prosemirror-keymap

# pnpm
pnpm add prosemirror-paste-rules prosemirror-view prosemirror-state prosemirror-keymap

# npm
npm install prosemirror-paste-rules 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 { paste } from 'prosemirror-paste-rules';
import { schema } from 'prosemirror-schema-basic';

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

Readme

Keywords

none

Package Sidebar

Install

npm i prosemirror-paste-rules

Weekly Downloads

26,734

Version

2.0.7

License

MIT

Unpacked Size

89.9 kB

Total Files

10

Last publish

Collaborators

  • ifiokjr