WYSIWYG or Editor.js/Tiptap renderer
How do you render things like Block Editor and WYSIWYG blocks ?
I'm working with latest version of Nuxt and Directus annd trying to render "richtext" blocks of directus in Nuxt, how would you do it ?
I used to work with Strapi that has a dedicated module for that : https://github.com/freb97/nuxt-strapi-blocks-renderer
Just to be clear I'm not looking to have the editor in my frontend but just render the blocks created in backend inside Nuxt as html
6 Replies
vue's
v-html
?For richtext yes but block editor is returning an object like
what are u using to output this?
Have a look here:
https://tiptap.dev/docs/editor/api/utilities/html
HTML utility | Tiptap Editor Docs
Use the HTML Utility in Tiptap to render JSON as HTML and convert HTML to JSON without an editor instance. More in the docs!
I think what you want is generateHtml from the doc + v-html
But for good measure the v-html warning:
Thank you very much @vogtm , this is definitly pointing into the right direction for the Block editor field. But the return data isn't match tiptap one. I'm gonna implement tiptap in directus instead and it should do the work then but I'm so surprised that the regular Block editor of Directus is absolutly useless and that I cannot find any documentation about it...
Indeed setting up tiptap editor works like a charm!
Only caveat I'm still facing is how to remove some fields of StaterKit (like removing some headings options or list for example) :!