# prosemirror-paste-rules

> Better handling of pasted content in your prosemirror editor.

Latest version **3.0.0** (published 2024-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install prosemirror-paste-rules
pnpm add prosemirror-paste-rules
yarn add prosemirror-paste-rules
bun add prosemirror-paste-rules
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-07-30 |
| First published | 2021-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 97.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3036 |
| Maintainers | ifiokjr |

## Links

- npm: https://www.npmjs.com/package/prosemirror-paste-rules
- Repository: https://github.com/remirror/remirror
- Homepage: https://github.com/remirror/remirror/tree/HEAD/packages/prosemirror-paste-rules
- Issues: https://github.com/remirror/remirror/issues
- npm.io page: https://npm.io/package/prosemirror-paste-rules

## Dependencies (4)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.22.3
- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^4.0.0
- [@remirror/core-helpers](https://npm.io/package/@remirror/core-helpers.md) 4.0.0
- [@remirror/core-constants](https://npm.io/package/@remirror/core-constants.md) 3.0.0

## Recent versions

- 3.0.0 (latest) — 2024-07-30
- 3.0.0-beta.6 (beta) — 2024-07-22
- 0.0.0-pr2271.2 (pr2271) — 2024-07-18
- 0.0.0-pr2222.1 (pr2222) — 2023-12-12
- 0.0.0-pr2223.1 (pr2223) — 2023-12-12
- 0.0.0-pr2169.2 (pr2169) — 2023-11-06
- 0.0.0-pr2166.4 (pr2166) — 2023-10-06
- 0.0.0-pr2156.1 (pr2156) — 2023-09-28
- 0.0.0-pr2128.4 (pr2128) — 2023-07-26
- 0.0.0-pr2118.1 (pr2118) — 2023-07-13
- 0.0.0-pr2100.1 (pr2100) — 2023-06-28
- 0.0.0-pr1966.1 (pr1966) — 2022-12-26
- 0.0.0-pr1948.1 (pr1948) — 2022-11-25
- 0.0.0-pr1942.1 (pr1942) — 2022-11-21
- 0.0.0-pr1938.1 (pr1938) — 2022-11-15
- … 197 more at https://npm.io/package/prosemirror-paste-rules/versions

## README

# prosemirror-paste-rules

> Better handling of pasted content in the editor.

[![Version][version]][npm] [![Weekly Downloads][downloads-badge]][npm] [![Bundled size][size-badge]][size] [![Typed Codebase][typescript]](#) [![MIT License][license]](#)

[version]: https://flat.badgen.net/npm/v/prosemirror-paste-rules
[npm]: https://npmjs.com/package/prosemirror-paste-rules
[license]: https://flat.badgen.net/badge/license/MIT/purple
[size]: https://bundlephobia.com/result?p=prosemirror-paste-rules
[size-badge]: https://flat.badgen.net/bundlephobia/minzip/prosemirror-paste-rules
[typescript]: https://flat.badgen.net/badge/icon/TypeScript?icon=typescript&label
[downloads-badge]: https://badgen.net/npm/dw/prosemirror-paste-rules/red?icon=npm

<br />

## 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.

<br />

## Installation

```bash
# 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.

<br />

## Getting Started

```ts
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([])],
});
```

---
_Source: https://npm.io/package/prosemirror-paste-rules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
