Skip to content Skip to sidebar Skip to footer

How To Render The Content Of React Quill Without The Html Markup?

I managed to get my Quill working, but now I wanted to display the contents from the editor without the html markup. I tried using react-render-html npm package, it was working fin

Solution 1:

Looking at your server response, the HTML tag is escaped. You need to escape it first before passing to HTML parser.

You can use html-entities to decode the server response. The easiest way is to replace all < and > characters.

const decodedHtml = htmlEntities.decode(html)
// or
const decodedHtml = html.replace(/&lt;/g, '<').replace(/&gt;/g, '>')

return htmr(decodedHtml)

Post a Comment for "How To Render The Content Of React Quill Without The Html Markup?"