A react hook for parsing markdown with marked and sanitize-html
The app located at /example
demonstrates how it could be used, see the live result at https://this-fifo.github.io/use-marked-hook/
yarn add use-marked-hook
import React from "react";
import { useMarked } from "use-marked-hook";
const App = () => {
const markdown = `**bold content**`;
const html = useMarked(markdown);
// html -> <p></strong>bold content</strong></p>
return <div dangerouslySetInnerHTML={{ __html: html }} />;
};
MIT © Filipe Herculano