Remove text color and background color in Tiptap/Prosemirror on paste

1.1k Views Asked by At

How can I remove the color and background color from pasted text in tiptap/prosemirror, in a clean way? I have a specific palette of colors that are allowed for the text in the editor, and I don't want people pasting from other places to be able to overwrite that.

I could intercept the paste, parse the string and remove style attributes but I'm thinking there must be a cleaner way to do this.

0

There are 0 best solutions below