10 lines
281 B
JavaScript
10 lines
281 B
JavaScript
import parse from 'html-react-parser';
|
|
import { isNil } from 'ramda';
|
|
import DOMPurify from 'dompurify';
|
|
|
|
const renderHtmlContent = (content = '') => {
|
|
const clean = DOMPurify.sanitize(content);
|
|
return !isNil(clean) ? parse(clean) : '';
|
|
}
|
|
|
|
export default renderHtmlContent; |