please, is there any way to parse without errors a content that contains html tags and some text inside strips < and >.
I've tried:
import DOMPurify from 'dompurify';
import parse from 'html-react-parser';
const htmlString = '<p>test<br/><img src="....." />... <[email protected]></p>';
const cleanedHTML = DOMPurify.sanitize(htmlString);
<td>{parse(cleanedHTML)}</td>
It works fine But it removes the content [email protected] ( THIS IS JUST AN EXAMPLE OF WHAT CAN BE BETWEEN STRIPS), and when I dont use dompurify.santitize I got errors: Uncaught DOMException: String contains an invalid character.
Try to use helper libs;
dompurify, andhtml-react-parserhere is an example of how you can use those libs: