The first HTML5 compliant HTML decoder based on <a href="https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references">HTML5 specification</a> and can decode the full named character reference list based on this <a href="https://html
npm install html-decoderHTML Decoder
===============================
The first HTML5 compliant HTML decoder. This decoder is implemented based on the HTML5 specification and can decode the full named character reference list based on this json.
Install the npm html-decoder from the npm repo.
``sh`
npm install html-decoder
Decoding a string with numeric and named character reference.
`js
/ create the html decoder /
var HTMLDecoder = require("html-decoder");
decoder = new HTMLDecoder();
var htmlString = ">>>a ...";
/ html = '<<
var html = decoder.decode(htmlString);
`
`sh`
grunt
sh
grunt test
`Maintenance
$3
`sh
grunt gen
`OR doing it manually
$3
`sh
wget https://html.spec.whatwg.org/multipage/entities.json
`$3
`sh
$REPO_HOME is the home directory of this repo.
cp entities.json $REPO_HOME/data the output is saved @ src/gen/trie.js
./bin/genhtmlentities data/entities.json
`$3
`sh
grunt test
``This software is free to use under the BSD license.
See the LICENSE file for license text and copyright information.