I would love to know what technique Vanessa is using to persist the editor content in a database. TipTap exposes methods to export as JSON and HTML. I'm using HTML export because there are mature packages I can use to sanitize the content before persisting into the database.
I went for HTML/text format, because I need to parse the content in table cells, and editing happens for individual content when the user hits Enter. For this part then, ProseMirror can parse the content as well, from a dummy div element where its innerHTML content is the HTML/text stored. And I think you don't need to worry about sanitizing the content (if it's saved from ProseMirror beforehand) as it only allows content based on the schema you defined. Anything pasted or written in the editor will be forced to parse according to the schema.
@@clelsonlopes you're right about pasting content into editor being sanitized client side. but if I want to take that same html string and render it into a pdf, or use it anywhere else, I'd have to sanitize it server side before serving to the consumer
Its great content!
I'm using TipTap with NuxtUI and it's looking and feeling real nice
Пошли интересные темы ❤ 🇩🇪🇩🇪
I would love to know what technique Vanessa is using to persist the editor content in a database.
TipTap exposes methods to export as JSON and HTML.
I'm using HTML export because there are mature packages I can use to sanitize the content before persisting into the database.
I went for HTML/text format, because I need to parse the content in table cells, and editing happens for individual content when the user hits Enter. For this part then, ProseMirror can parse the content as well, from a dummy div element where its innerHTML content is the HTML/text stored. And I think you don't need to worry about sanitizing the content (if it's saved from ProseMirror beforehand) as it only allows content based on the schema you defined. Anything pasted or written in the editor will be forced to parse according to the schema.
@@clelsonlopes you're right about pasting content into editor being sanitized client side. but if I want to take that same html string and render it into a pdf, or use it anywhere else, I'd have to sanitize it server side before serving to the consumer