'Remove text color and background color in Tiptap/Prosemirror on paste
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
