mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-07 21:07:47 +00:00
Add initial migration to NextJS
This commit is contained in:
12
lib/markdownToHtml.ts
Normal file
12
lib/markdownToHtml.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user