Skip to content

Wrapper for parsing markdown text into html

License

Notifications You must be signed in to change notification settings

scheduleonce/markdown-safe

Repository files navigation

markdown-safe

Build status styled with prettier

Thin wrapper for markdown parsing and output sanitization

Installation

To install this module, run the following command:

$ npm install --save @oncehub/markdown-safe

Usage

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);

Development

Tests

Run tests via npm test.

Deployment

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.

License

This module is licensed under the MIT License. See the LICENSE file for details.