Thin wrapper for markdown parsing and output sanitization
To install this module, run the following command:
$ npm install --save @oncehub/markdown-safe
import { renderMarkdown } from "@oncehub/markdown-safe";
const markdown = `
# This is a heading
This is some **bold** text, and here's a [link](https://example.com).
`;
const safeHtml = renderMarkdown(markdown);
// Now you can use 'safeHtml' (e.g., set it as the innerHTML of an element)
console.log(safeHtml);
Run tests via npm test
.
Package is automatically published to npm when creating a new release on Github. Check out the release section in the repo. Read more about releases here.
This module is licensed under the MIT License. See the LICENSE file for details.