pc__replace_id_in_html
v0.0.1
Published
This is plugin for nmp-package "Post-Compression". He`s searching and replaces long attribute value "id" on short value, in the HTML code.
Downloads
3
Maintainers
Readme
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>