3.0.0 • Published 5 years ago

posthtml-rename-attrs v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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);
    });

// <div prefix-class="wow">OMG</div>
3.0.0

5 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago