Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including rehype with all npm packages installed. Try it out:

var rehype = require("rehype")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

rehype v7.0.0

HTML processor powered by plugins

rehype

Build Coverage Downloads Size Chat

rehype is an HTML processor powered by plugins part of the unified collective.

Don’t need the parser? Or the compiler? That’s OK.


Announcing the unified collective! 🎉 Read more about it on Medium »

Sponsors



🥇 ZEIT


🥇 Gatsby


🥉 Compositor


Holloway




You?

Installation

npm:

npm install rehype

Usage

var rehype = require('rehype')
var report = require('vfile-reporter')

rehype().process('<title>Hi</title><h2>Hello world!', function(err, file) {
  console.log(report(err || file))
  console.log(String(file))
})

Yields:

no issues found
<html><head><title>Hi</title></head><body><h2>Hello world!</h2></body></html>

Configuration for rehype-parse and rehype-stringify can be set with .data('settings', {/*...*/}).

License

MIT © Titus Wormer

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free