While the tokenizer will gracefully decode most encoded characters:
⇒ node
> var Tokenizer = require( 'simple-html-tokenizer' );
undefined
> Tokenizer.tokenize( '&' )[ 0 ].chars === '&'
true
It doesn't handle characters whose encodings exceed 16 bits (e.g. emoji):
⇒ node
> var Tokenizer = require( 'simple-html-tokenizer' );
undefined
> Tokenizer.tokenize( '😅' )[ 0 ].chars === '😅'
false
It may be that EntityParser should use String.fromCodePoint in place of String.fromCharCode instead, or an equivalent polyfill?
Related:
While the tokenizer will gracefully decode most encoded characters:
It doesn't handle characters whose encodings exceed 16 bits (e.g. emoji):
It may be that
EntityParsershould useString.fromCodePointin place ofString.fromCharCodeinstead, or an equivalent polyfill?Related: