Plugin for convert character entities (html, xml & etc)
for example html2xml:
-> #&160;
< -> <
$ npm install --save-dev gulp-converter-character-entities
var gulp = require('gulp');
var cce = require('gulp-converter-character-entities');
var my_entity = cce.entities.html2xml;
gulp.task('cmu', function () {
return gulp.src('src/file.html')
.pipe(cce.convert({entity: my_entity}))
.pipe(gulp.dest('dist'));
});
or with Jade
var gulp = require('gulp');
var jade = require('jade');
var cce = require('gulp-converter-character-entities');
var my_entity = cce.entities.html2xml;
gulp.task('cmu', function () {
return gulp.src('src/file.jade')
.pipe(jade())
.pipe(cce.convert({entity: my_entity}))
.pipe(gulp.dest('dist'));
});
var my_entity - simple json
{
"key": "value",
" ": " "
}
MIT © free6k