summaryrefslogtreecommitdiff
path: root/src/utils/markdown.ts
blob: 946d8d835f6c68d3aabd6bc06be1185d1bbb664d (plain)
1
2
3
4
5
6
7
8
9
10
11
import { marked } from "marked";

marked.setOptions({
	breaks: true,
	gfm: true,
});

export function markdownToHtml(markdown: string): string {
	const html = marked.parse(markdown);
	return typeof html === "string" ? html : "";
}