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);
    });
 
// <div prefix-class="wow">OMG</div>

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i posthtml-rename-attrs

    Weekly Downloads

    4

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.74 kB

    Total Files

    4

    Last publish

    Collaborators

    • madzhup
    • scrum