Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jstnjns/gulp-html-entities
For encoding or decoding HTML entities in your markup.
https://github.com/jstnjns/gulp-html-entities
Last synced: 11 days ago
JSON representation
For encoding or decoding HTML entities in your markup.
- Host: GitHub
- URL: https://github.com/jstnjns/gulp-html-entities
- Owner: jstnjns
- Created: 2015-02-05T19:40:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-23T21:48:23.000Z (over 8 years ago)
- Last Synced: 2024-12-01T09:09:17.132Z (23 days ago)
- Language: HTML
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-html-entities
For encoding or decoding HTML entities in your markup.## Encode
```
gulp.task('encode', function() {
return gulp.src('./input/without-entities.html')
.pipe(entities('encode'))
.pipe(rename('encoded.html'))
.pipe(gulp.dest('./output/'));
});
```
####Methods
+ *encode* — encodes, replacing characters to its entity representations. Ignores UTF characters with no entity representation.
+ *encodeNonUTF* — encodes, replacing characters to its entity representations. Inserts numeric entities for UTF characters.
+ *encodeNonASCII* — encodes, replacing only non-ASCII characters to its numeric entity representations.## Decode
```
gulp.task('decode', function() {
return gulp.src('./input/with-entities.html')
.pipe(entities('decode'))
.pipe(rename('decoded.html'))
.pipe(gulp.dest('./output'));
});
```
#### Methods
+ *decode* — decodes, replacing entities to characters. Unknown entities are left as is.