1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export const turndown = async (text) => {
const turndown = await import("npm:turndown");
const plugin = await import("npm:turndown-plugin-gfm");
const turndownService = new turndown.default({
emDelimiter: "*",
codeBlockStyle: "fenced",
});
turndownService.use(plugin.gfm);
return turndownService.turndown(text);
};
let html = "<h1>hello</h1>"
console.log(await turndown(html)