1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { fetch } from "https://esm.town/v/std/fetch";
export const markdownToHtml = async (res, req) => {
const remarkHtml = (await import("npm:remark-html")).default;
const unified = (await import("npm:unified")).unified;
const markdown = (await import("npm:remark-parse")).default;
const markdownToConvert = fetch(
"https://jessmartin-todoMarkdown.express.val.run",
);
unified()
.use(markdown)
.use(remarkHtml)
.process(markdownToConvert, function (err, file) {
if (err)
throw err;
res.send("test");
});
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
v13
October 23, 2023