rehype
Rehype is a JavaScript tool in the unified ecosystem that enables processing HTML through a plugin-based pipeline. It reads HTML into a Hypertext Abstract Syntax Tree (HAST), applies a series of plugins to transform that tree, and then serializes the result back to HTML. Rehype is designed to work alongside remark, which handles Markdown, allowing developers to build end-to-end content pipelines that originate from Markdown or HTML and end in HTML.
At the core, rehype uses a processor that runs plugins in sequence. Typical components include rehype-parse,
Common use cases include sanitizing user input, adding anchors to headings, removing disallowed tags, optimizing markup,
As part of the unified project, rehype emphasizes a consistent, declarative approach to HTML processing. Its