Search code examples
reactjsmarkdowntext-editorstrapireact-quill

Why does rich texts on strapi keeps markups visible in my app


I have some problems with the strapi rich text editor. When I type some text, the format doesn't appear at all in the render of my app. No line break. Plus, the markDown code stays visible.

I tried by replacing the strapi text editor by react-quill and I still have the same problem. I type some text in the admin panel and when I render my app, all the html is visible.

What did I miss?

screen shot of the app


Solution

  • This is probably because you have to "say" to React that the content is HTML.

    Could you try using the dangerouslySetInnerHTML prop?

    Another solution would be to use react-markdown, as explained in this tutorial.