awinogradov / posthtml-extend-attrs

Transform html attrs with css properties to svg attrs
8 stars 2 forks source link

posthtml-extend-attrs

PostHTMLExtendAttrs is plugin for PostHTML. It extend HTML attrs with new attrs and data.

Usage

var posthtml = require('posthtml'),
    html = '<div class="wow">OMG</div>';

posthtml([ require('posthtml-extend-attrs')({
    attrsTree: { '.wow' : { id: 'wow_id' }}
})])
    .process(html)
    .then(function(result) {
        console.log(result);
    });

// <div class="wow" id="wow_id">OMG</div>