remark plugin to change header levels (<h1>
s to <h2>
s, <h2>
s to <h3>
s, etc.)
Use remark-behead instead, which is more flexible and better-maintained.
npm install remark-rewrite-headers
var remark = require('remark');
var html = require('remark-html');
var rewriteHeaders = require('remark-rewrite-headers');
var processor = remark().use(rewriteHeaders).use(html);
// No output
processor.process([
'# Some Markdown',
'The above will become an `<h2>` althouth normally it would be an `<h1>`.',
'## Some more Markdown',
'Ditto with the above - this one\'ll become an `<h3>`.'
].join('\n'));
LGPL 3.0+
AJ Jordan alex@strugee.net