Documentation

Paste and schema

Choose which formats to keep when pasting.

Try it

Copy the sample below and paste it into the editor. Bold and the link keep their formatting. Italics become plain text.

Bold text · Italic text · Link

Live example
Example result

Add it to your editor

Pick the formats your editor should keep by registering the corresponding extensions. The built-in paste handler reads the clipboard and applies the active schema.

import { Bold, Code, EditorContent, EditorProvider, Heading, Link, useEditor } from 'yurich';

export function ClipboardEditor() {
  const editor = useEditor({ extensions: [Bold, Code, Heading, Link] });

  return (
    <EditorProvider editor={editor}>
      <EditorContent ariaLabel="Paste formatted text here" />
    </EditorProvider>
  );
}

Behavior to account for

With Heading, Code, and Link enabled, you can copy this section from its heading through the Features link below and paste it with its formatting intact. Plain-text paste inserts text without parsing it as HTML. Dropping content into the editor is disabled. Register Italic if italic needs to survive paste and export.

Features