posthtml-rename-attrs
3.0.0 • Public • Published posthtml-rename-attrs
PostHTMLRenameAttrs is plugin for PostHTML. It rename HTML tags attrs with passed function.
Usage
const posthtml = require('posthtml'),
html = '<div class="wow">OMG</div>';
const prefix = v => v === 'class' ? `prefix-${v}` : v;
posthtml([ require('posthtml-rename-attrs')(prefix)])
.process(html)
.then(function(result) {
console.log(result);
});
Dependencies (0)
Dev Dependencies (4)
Package Sidebar
Install
npm i posthtml-rename-attrs
Weekly Downloads