0

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

Rom-888
  • 681
  • 2
  • 9
  • 30

1 Answers1

1

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.

Pierre
  • 986
  • 8
  • 13
  • Ok. It wasn't specified in the tuto, but I need to import react-quill or react-markdown in each page of the frontend where I use some rich text? – Rom-888 Sep 15 '21 at 09:39
  • that makes sens. Thank you, I missed that part of the tutorial – Rom-888 Sep 15 '21 at 09:53