gulp-html-rebuild
Run minodisk/htmlparser2#stack-storage and rebuild html.
Parse and rebuild html to observe coding conventions, and so on.
Install
$ npm install --save-dev gulp-html-rebuild
Usage
var gulp = ;var rebuild = ; gulp;
API
rebuild(options)
Gulp plugin for rebuilding html.
- Params:
- options
Object
- Options for rebuilding html.- onprocessinginstruction
Function
- Replace instruction with returned string. Default:function (name, value) { return "<" + value + ">"; }
- onopentag
Function
- Replace open tag with returned string. Default:function (name, attrs) { return "<" + name + createAttrStr(attrs) + ">"; }
- onclosetag
Function
- Replace close tag with returned string. Default:function (name, attrs) { return "</" + name + ">"; }
- ontext
Function
- Replace text with returned string. Default:function (value) { return value; }
- oncomment
Function
- Replace comment with returned string. Default:function (value) { return "<!--" + value + "-->"; }
- onprocessinginstruction
- options
rebuild.createAttrStr(attrs)
Helper for creating attribute.
- Params:
- attrs
Object
- A map of the attribute.
- attrs
- Returns:
String
- A string of the attribute starting with whitespace.