mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 21:07:47 +00:00
13 lines
333 B
TypeScript
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()
|
|
}
|