yahoo/html-decoder

Name: html-decoder

Owner: Yahoo Inc.

Description: The first HTML5 compliant HTML decoder.

Created: 2015-06-18 04:42:12.0

Updated: 2015-06-24 16:01:05.0

Pushed: 2015-06-25 07:50:46.0

Homepage:

Size: 217

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

HTML 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.

Quick Start

Install the npm html-decoder from the npm repo.

install html-decoder
Server-side Use (node.js)

Decoding a string with numeric and named character reference.

reate the html decoder */
HTMLDecoder = require("html-decoder");

htmlString = ">&gt&gta ...";
tml = '<<<a...'; */
html = HTMLDecoder.decode(htmlString);
Development
How to build
run-script build
How to test
test
Maintenance
Get the latest named character reference json from whatwg.org
run-script gen
OR doing it manually
 https://html.spec.whatwg.org/multipage/entities.json
Generate the trie
EPO_HOME is the home directory of this repo.
ntities.json $REPO_HOME/data 

e output is saved @ src/gen/trie.js
n/genhtmlentities data/entities.json
Test the build again
test
License

This software is free to use under the BSD license. See the LICENSE file for license text and copyright information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.