Skip to content

awinogradov/posthtml-extend-attrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 24, 2015
97fbbc0 · Nov 24, 2015

History

19 Commits
Nov 14, 2015
Jul 3, 2015
Jul 3, 2015
Jul 3, 2015
Jul 3, 2015
Jul 3, 2015
Nov 14, 2015
Nov 24, 2015

Repository files navigation

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>