Convert the Markdown body to sanitised HTML.
\
โ
`
remark-parse
remark-gfm
remark-rehype
allowDangerousHtml: true
<pre class="mermaid">
rehype-raw
rm-
id=
rehype-autolink-headings
<a>
behavior: 'append'
<table>
<div class="rm-table-wrap">
rehype-sanitize
rehype-stringify
allowDangerousHtml: false
sanitised HTML string
Convert the Markdown body to sanitised HTML.
Pipeline stages
\``mermaidโremark-parse+remark-gfmโ parse markdown (incl. GFM tables / task lists / strikethrough)remark-rehypewithallowDangerousHtml: trueโ preserve the<pre class="mermaid">wrappersrehype-rawโ re-parse the preserved raw HTML into the HAST treerm--prefixedid=attributes on every headingrehype-autolink-headingsโ append an anchor<a>child to every heading for deep-linking (behavior: 'append')<table>in<div class="rm-table-wrap">rehype-sanitizewith sanitizeSchema โ scrub anything not in the allow-listrehype-stringifyโ serialise HAST โ HTML withallowDangerousHtml: false