unified processor to use browser APIs to parse and compile HTML.
- Interface by unified
- hast syntax tree
- Parses HTML to the tree with rehype-dom-parse
- Plug-ins transform the tree
- Compiles the tree to HTML using rehype-dom-stringify
If you don’t care about bundle size, or if you don’t trust content, or if you’re
not in a (modern) browser environment, use
If you’re not concerned with bundle size or are in an environment in which you
don’t trust (or don’t have) the native DOM API, you may prefer to use
rehype-dom is designed for browser use, it defaults to parsing in
fragment mode, whereas
rehype defaults to document mode!
Don’t need the parser? Or the compiler? That’s OK.
yarn add rehype-dom
npm install rehype-dom
This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.