sfcode
An Online Competing and Development Environment
|
Encode and decode HTML entities
Escape unsafe characters in str
with html entities.
By default, entities are encoded with numeric decimal codes.
If opts.numeric
is false or opts.named
is true, encoding will used named codes like π
.
If opts.special
is set to an Object, the key names will be forced to be encoded (defaults to forcing: ‘<>’"&`). For example:
Convert html entities in str
back to raw text.
HTML entity tables shamelessly lifted from perl's HTML::Entities
With npm do:
MIT