Files
unicorn-utterances/lib/markdownToHtml.ts
2021-12-10 12:58:26 -08:00

13 lines
333 B
TypeScript

import remark from 'remark'
import html from 'remark-html'
// TODO: Create types
const behead = require('remark-behead')
export default async function markdownToHtml(markdown: string) {
const result = await remark()
.use(behead, { after: 0, depth: 1 })
.use(html)
.process(markdown)
return result.toString()
}