Does tiptap sanitize input/output by default? #42
-
Hi; This is sort of a naive question, and it's been a while since I used tiptap. I remember last time around being some warnings/discussions about how it [tiptap] doesn't sanitize input, and it's up to the dev to fix that. If it doesn't sanitize by default, what are your recommendations on validating/sanitizing user input? I know this question is better asked over there, but was hoping to gather your thoughts. Thanks again for the lib. 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Nope. Tiptap doesn't include sanitization by default. But in most cases, you don't need it. Sure, Yeah, as said, this library is just to make Tiptap work with svelte smoothly; it doesn't take any other overheads. And the question might be a better fit on the tiptap repo. My thoughts on sanitization would be that it doesn't matter whether the client sanitzes the content or not; one has to validate/sanitize user inputs on the server before processing them. Even if the client implements sanitization, sometimes it is hard or complex to get exactly the same output that the client library and server library produce. And to implement sanitization, you may be able to do these things:
There is also a vague mention on security in Titptap docs https://tiptap.dev/docs/editor/guide/output#security |
Beta Was this translation helpful? Give feedback.
Nope. Tiptap doesn't include sanitization by default.
But in most cases, you don't need it.
Sure, Yeah, as said, this library is just to make Tiptap work with svelte smoothly; it doesn't take any other overheads. And the question might be a better fit on the tiptap repo.
My thoughts on sanitization would be that it doesn't matter whether the client sanitzes the content or not; one has to validate/sanitize user inputs on the server before processing them. Even if the client implements sanitization, sometimes it is hard or complex to get exactly the same output that the client library and server library produce.
And to implement sanitization, you may be able to do these things: