Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
export const markdownToHtml = async (md: string) => {
const remarkHtml = (await import("npm:remark-html")).default;
const { unified } = await import("https://esm.sh/unified@10?bundle");
const markdown = (await import("npm:remark-parse")).default;
const file = await unified()
.use(markdown)
.use(remarkHtml)
.process(md);
return String(file);
};
October 23, 2023