Html React Parser Doesn't Render Empty <p> Tags

534 Views Asked by At

I am using html-react-parser for my rich text editor which is draft-js.

The problem is when I send empty spaces to the backend it just sends multiple empty

tags and this is what I get back from the database.

Having said that my parser completely ignores them.

I tried looking into the documentation: https://www.npmjs.com/package/html-react-parser but I can't seem to find the answer I am looking for.

I am using it in the most basic way, just parse() and inside my content that I get from the DB.

Here is the response I get:

<p>1</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p>2</p><p>3</p>"

Can anyone please help?

Thanks in advance!

0

There are 0 best solutions below