Created
May 31, 2019 20:07
-
-
Save thebiltheory/ab38d6c6cebca1179231292d99acc5e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parse from "html-react-parser"; | |
import DOMPurify from "dompurify"; | |
export default function parseHtml(response) { | |
if (response) { | |
const dirty = response; | |
const clean = DOMPurify.sanitize(dirty); | |
return parse(clean); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment