json-theme-even-fork/utils/markdown.js

8 lines
204 B
JavaScript
Raw Normal View History

import micromark from 'micromark'
import striptags from 'striptags'
export default function markdown(doc, stripTags = false) {
const html = micromark(doc)
return stripTags ? striptags(html) : html
}