pc__replace_id_in_html

0.0.1 • Public • Published

Replace id in HTML

This is plugin for nmp-package "Post-Compression".
He`s searching and replaces long attribute value "id" on short value, in the HTML code.

An example of using:

var replaceIdInHTML = require("pc__replace_id_in_html");
 
gulp.src("./*.html")
    .pipe(postCompression.replace([
        replaceIdInHTML()
    ], shortNames));  

Where:

  • shortNames - an object of type JSON with rules replace the long words to short words.

An example of the JSON object "shortNames":

{
    "id_in_html": {      // the name of the group names
        "someIdA": "a",     // long name: short name
        "someIdB": "b"
    }
}

An example of HTML code before:

<p id="someIdA"></p>
<p id="someIdB"></p>

An example of HTML code after:

<p id="a"></p>
<p id="b"></p>

Package Sidebar

Install

npm i pc__replace_id_in_html

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • bakhirev