You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Brett Woodruff
28c8d411ad
|
7 months ago | |
---|---|---|
.. | ||
lib | 7 months ago | |
maps | 7 months ago | |
LICENSE | 7 months ago | |
index.js | 7 months ago | |
package.json | 7 months ago | |
readme.md | 7 months ago |
readme.md
En- & decoder for XML/HTML entities.
####Features:
- Focussed on speed
- Supports three levels of entities: XML, HTML4 & HTML5
- Supports char code entities (eg.
U
)
- Supports char code entities (eg.
##How to…
###…install entities
npm i entities
###…use entities
//encoding
require("entities").encode(<str> data[, <int> level]);
//decoding
require("entities").decode(<str> data[, <int> level]);
The level
attribute indicates what level of entities should be decoded (0 = XML, 1 = HTML4 and 2 = HTML5). The default is 0 (read: XML).
There are also methods to access the level directly. Just append the name of the level to the action and you're ready to go (e.g. encodeHTML4(data)
, decodeXML(data)
).
License: BSD-like