Skip to content

extenion for the Tiptap editor that provides clean paste functionality, allowing users to strip unwanted content like formatting and styles from pasted text

Notifications You must be signed in to change notification settings

unicscode/tiptap-clean-paste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiptap-clean-paste

The Tiptap Clean Paste Extension is a plugin for Tiptap that provides a clean paste functionality for your editor. It allows you to strip unwanted content from pasted text, such as formatting, styles, or non-printable characters.

Installation

You can install the Tiptap Clean Paste Extension via npm:

npm install tiptap-clean-paste

Installation

To use the tiptap-clean-paste Extension in your Tiptap editor, import it and add it to your extensions list:

import { CleanPaste } from "tiptap-clean-paste";
// or
import CleanPaste from "tiptap-clean-paste";

// Using the default regex pattern
const extensions = [CleanPaste];

// Or define your custom regex pattern
const customRegex = /[^\x20-\x7E\s]/g;
const extensions = [
  CleanPaste.configure({
    regexPattern: customRegex, // customize the regex pattern used for cleaning pasted text
  }),
];

const TiptapEditor = () => {
  const editor = useEditor({
    extensions,
    content: "<p>Hello World!</p>",
  });
};

About

extenion for the Tiptap editor that provides clean paste functionality, allowing users to strip unwanted content like formatting and styles from pasted text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published