rehype
Plugin-based processor that transforms HTML as a syntax tree, part of the unified collective's ecosystem.
rehype is the HTML processor of the unified ecosystem. It adds support for HTML to unified: it parses HTML into a syntax tree, runs plugins that inspect and change that tree, and writes the result back out as HTML. The npm package combines the parser and the serializer with unified. The separate rehype-parse and rehype-stringify packages cover one half each, and rehype-cli inspects and formats HTML in scripts.
The package runs in Node.js and in Deno, and can be loaded in browsers from esm.sh. Plugins are separate packages, some kept by the rehype organization and others by outside authors.
Worth knowing
The package is ESM only. Improper use of HTML can open a site to cross-site scripting, and the README points to rehype-sanitize to make a tree safe. Plugins can open other attacks.
Identity
Rendering and deploy
- Install with
- npm, cdn4
Releases
Adoption
Sources
- 2026-11-16: links
unifiedjs.com/ - 2026-11-16: links, Written in, License, GitHub stars
api.github.com/repos/rehypejs/rehype - 2026-11-16: Categories
github.com/rehypejs/rehype/blob/main/readme.md - 2026-11-16: Runtime, Install with, Minimum runtime
github.com/rehypejs/rehype/blob/main/packages/rehype/readme.md - 2026-11-16: Maintainer
github.com/rehypejs/rehype/blob/main/license - 2026-11-16: First release
api.github.com/repos/rehypejs/rehype/commits/1.0.0 - 2026-11-16: Current major version, Last release
github.com/rehypejs/rehype/releases/tag/13.0.2 - 2026-11-16: Contributors
api.github.com/repos/rehypejs/rehype/contributors?per_page=1 - 2026-11-16: npm downloads a week
api.npmjs.org/downloads/range/2026-11-01:2026-11-07/rehype - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/rehype