@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