Do I need to sanitise TIPTAP text editor in nextJS?

299 Views Asked by At

do I need to sanitise TIPTAP text editor with nextJs? If so, what sanitiser is best with nextJS and TIPTAP text editor?

1

There are 1 best solutions below

0
plantsplantsplants On

From TipTap docs:

"[...]if there are some tags or attributes that aren’t allowed (based on your configuration), Tiptap just throws them away quietly." https://tiptap.dev/guide/output

You should still sanitize on the server, before saving to db. You can use https://www.npmjs.com/package/sanitize-html or similar package.