import marked from 'marked';
import sanitizeHtml from 'sanitize-html';
// [...]
export default function TextWithMarkdown({text}) {
return (
<div
className="text-with-markdown"
dangerouslySetInnerHTML={{
__html: sanitizeHtml(marked(text), {
allowedTags,
allowedAttributes,
}),
}}
/>
);
}