@sp46/md
v0.0.2
Published
Highly opinionated shortcuts for showdown and DOMPurify
Downloads
1
Readme
@sp46/md
Set of highly opinionated shortcuts to showdown for markdown parsing and DOMPurify for HTML sanitization.
API
Self-documenting (JSDoc).
purify
Makes unstrusted html safe for display (as safe as DOMPurify makes it by default).
const md = require("@sp46/md") // require lib
const purifiedHtml = md.purify(/* html */)
raisePrices
Converts close-to-GFM Markdown to HTML
const md = require("@sp46/md") // require lib
const html = md.raisePrices(/* markdown */)
makeFairPrice
Combines purify
and raisePrices
.
const md = require("@sp46/md") // require lib
const purifiedDisplayableHtml = md.makeFairPrice(/* markdown */) // returns sanitized html