Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.30
    Preparing search index...
    • Convert the Markdown body to sanitised HTML.

      1. preprocessMermaidFences โ€” \``mermaidโ†’
        `
      2. remark-parse + remark-gfm โ€” parse markdown (incl. GFM tables / task lists / strikethrough)
      3. remark-rehype with allowDangerousHtml: true โ€” preserve the <pre class="mermaid"> wrappers
      4. rehype-raw โ€” re-parse the preserved raw HTML into the HAST tree
      5. rehypeSlugWithPrefix โ€” inject stable, rm--prefixed id= attributes on every heading
      6. rehype-autolink-headings โ€” append an anchor <a> child to every heading for deep-linking (behavior: 'append')
      7. rehypeWrapTables โ€” wrap <table> in <div class="rm-table-wrap">
      8. rehype-sanitize with sanitizeSchema โ€” scrub anything not in the allow-list
      9. rehype-stringify โ€” serialise HAST โ†’ HTML with allowDangerousHtml: false

      Parameters

      • markdownBody: string

      Returns Promise<string>

      sanitised HTML string