const parseMarkdown = async (md) => { const { marked } = await import('https://esm.sh/marked@15.0.7'); const { default: DOMPurify } = await import('https://esm.sh/dompurify@3.2.3'); const renderer = new marked.Renderer(); const rules = { heading: (text, level) => `${text}`, paragraph: (text) => `

${text}

`, strong: (text) => `${text}`, em: (text) => `${text}`, link: (href, title, text) => `${text}`, code: (code) => `
${code}
`, codespan: (code) => `${code}`, list: (body, ordered) => ordered ? `
    ${body}
` : ``, listitem: (text) => `
  • ${text}
  • `, blockquote: (quote) => `
    ${quote}
    ` }; Object.keys(rules).forEach(rule => { renderer[rule] = (...args) => rules[rule](...args); }); marked.use({ renderer, breaks: true, gfm: true }); const rawHtml = marked.parse(md); return DOMPurify.sanitize(rawHtml); }; export default parseMarkdown; // Generation time: 11.318s // Result: FAIL