Skip to content

Semantic Paste

paste-semantic-html rewrites pasted HTML into a more semantic document structure. It is especially useful when content comes from Word or other rich-text sources that emit noisy markup.

Install

Terminal window
pnpm add @citolab/prose-extensions

Usage

import { createSemanticPastePlugin } from '@citolab/prose-extensions/paste-semantic-html';
const plugins = [createSemanticPastePlugin()];

ProseKit

If your app is built on ProseKit, use the extension wrapper instead. It requires the prosekit peer dependency:

import { defineSemanticPasteExtension } from '@citolab/prose-extensions/prosekit-extensions';
const semanticPasteExtension = defineSemanticPasteExtension();

Add the returned extension to your editor’s extension composition.

When to use

Use this when pasted content needs cleanup before it enters the editor document, especially for list-heavy copy/paste flows.