Miss any of our Open RFC calls?Watch the recordings here! »

rehype

4.0.0 • Public • Published

rehype Build Status Coverage Status Chat

The rehype processor is an HTML processor powered by plug-ins.

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

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