rehype-sanitize
Remove anything not on an allowlist schema; the default schema follows GitHub.
Filter a curated list of real rehype plugins, then select several to generate an npm install command and a starter pipeline.
Showing 28 plugins.
rehype-sanitizeRemove anything not on an allowlist schema; the default schema follows GitHub.
rehype-highlightSyntax-highlight code blocks with highlight.js grammars through lowlight.
rehype-starry-nightSyntax highlighting with starry-night: TextMate grammars, highlighting similar to what GitHub uses.
rehype-pretty-codeShiki-based highlighting with line and word highlighting (community, not in official list).
rehype-slugAdd GitHub-style id attributes to headings.
rehype-slug-custom-idHeading ids with support for {#custom-id} syntax.
rehype-autolink-headingsAdd links from headings to themselves (needs ids, e.g. from rehype-slug).
rehype-external-linksAdd rel and optional target attributes to external links.
rehype-formatPretty-print HTML by rewriting whitespace and indentation.
rehype-preset-minifyPreset of 23 minification plugins plus compact serializer settings.
rehype-minify-whitespaceCollapse whitespace between elements, respecting whitespace-sensitive content.
rehype-remove-commentsRemove HTML comments.
rehype-rawRe-parse the tree so raw HTML embedded in Markdown becomes real nodes.
rehype-remarkTurn HTML (hast) into Markdown (mdast) for remark.
rehype-retextBridge to retext so you can check the prose in HTML (spelling, readability).
rehype-reactCompile the tree to React elements instead of an HTML string.
rehype-documentWrap a fragment in a full HTML document with title, CSS and scripts.
rehype-metaAdd metadata such as Open Graph and Twitter Cards to the document head.
rehype-infer-title-metaInfer a title from the main heading into file metadata.
rehype-infer-description-metaInfer a description from the document content into file metadata.
rehype-infer-reading-time-metaEstimate reading time and store it as file metadata.
rehype-pictureWrap images in <picture> elements so one image source gets alternative formats.
rehype-katexRender math with KaTeX.
rehype-mathjaxRender math with MathJax.
rehype-mermaidRender Mermaid diagrams; outside browsers it uses Playwright (formerly rehype-mermaidjs).
rehype-calloutsRender blockquote-based callouts (admonitions and alerts).
rehype-citationAdd citations and a bibliography from BibTeX, with custom CSL styles.
rehype-accessible-emojisWrap emojis with role and aria-label so screen readers announce them (named export).
No plugins match. Search the official plugin list (opens in a new tab) for more.
Tick “Add” on plugins to generate an install command and starter code. Order matters: sanitize before plugins that add trusted markup, and format or minify last.
Every plugin here exists on npm and appears in the official rehype plugin list (opens in a new tab), except where marked "community, not in official list". Names, licenses and repositories were checked against the npm registry on November 11, 2026. The list is curated, not exhaustive: the official list has well over a hundred entries.
No ratings, download counts or star counts are shown, because those numbers change daily and we do not want to show stale figures. Follow the npm and GitHub links for current activity. The generated code uses each package's documented default export. For packages whose import style we could not confirm from their README, the builder links to their docs instead of guessing.
Other tools: HTML Formatter · HTML Minifier · HTML Sanitizer · HTML to Markdown · HTML Playground