Files
bflows-bandi-fe/src/helpers/renderHtmlContent.js
2024-10-24 15:41:34 +02:00

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;