10 lines
248 B
TypeScript
10 lines
248 B
TypeScript
|
|
import { Marked } from "marked"
|
||
|
|
import { gfmHeadingId } from "marked-gfm-heading-id"
|
||
|
|
|
||
|
|
export default function Markdown(md: string) {
|
||
|
|
return div.content(raw(marked.parse(md)))
|
||
|
|
}
|
||
|
|
|
||
|
|
const marked = new Marked({ gfm: true })
|
||
|
|
marked.use(gfmHeadingId())
|