Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 1.06 KB

File metadata and controls

67 lines (48 loc) · 1.06 KB

gulp-converter-character-entities

Plugin for convert character entities (html, xml & etc)

Support entities:

Example work:

for example html2xml:

  -> #&160;
< -> <

Install

$ npm install --save-dev gulp-converter-character-entities

Usage

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'));
});

Easy to expand

var my_entity - simple json

{
 "key": "value",
 " ": " "
}

License

MIT © free6k