entities 2.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/lib/decode.d.ts +13 -4
  2. package/lib/decode.d.ts.map +1 -1
  3. package/lib/decode.js +135 -42
  4. package/lib/decode.js.map +1 -0
  5. package/lib/decode_codepoint.d.ts +1 -0
  6. package/lib/decode_codepoint.d.ts.map +1 -1
  7. package/lib/decode_codepoint.js +42 -12
  8. package/lib/decode_codepoint.js.map +1 -0
  9. package/lib/encode-trie.d.ts +8 -0
  10. package/lib/encode-trie.d.ts.map +1 -0
  11. package/lib/encode-trie.js +78 -0
  12. package/lib/encode-trie.js.map +1 -0
  13. package/lib/encode.d.ts +20 -7
  14. package/lib/encode.d.ts.map +1 -1
  15. package/lib/encode.js +82 -93
  16. package/lib/encode.js.map +1 -0
  17. package/lib/esm/decode.d.ts +14 -0
  18. package/lib/esm/decode.d.ts.map +1 -0
  19. package/lib/esm/decode.js +135 -0
  20. package/lib/esm/decode.js.map +1 -0
  21. package/lib/esm/decode_codepoint.d.ts +3 -0
  22. package/lib/esm/decode_codepoint.d.ts.map +1 -0
  23. package/lib/esm/decode_codepoint.js +55 -0
  24. package/lib/esm/decode_codepoint.js.map +1 -0
  25. package/lib/esm/encode-trie.d.ts +8 -0
  26. package/lib/esm/encode-trie.d.ts.map +1 -0
  27. package/lib/esm/encode-trie.js +67 -0
  28. package/lib/esm/encode-trie.js.map +1 -0
  29. package/lib/esm/encode.d.ts +60 -0
  30. package/lib/esm/encode.d.ts.map +1 -0
  31. package/lib/esm/encode.js +119 -0
  32. package/lib/esm/encode.js.map +1 -0
  33. package/lib/esm/generated/decode-data-html.d.ts +3 -0
  34. package/lib/esm/generated/decode-data-html.d.ts.map +1 -0
  35. package/lib/esm/generated/decode-data-html.js +4 -0
  36. package/lib/esm/generated/decode-data-html.js.map +1 -0
  37. package/lib/esm/generated/decode-data-xml.d.ts +3 -0
  38. package/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
  39. package/lib/esm/generated/decode-data-xml.js +4 -0
  40. package/lib/esm/generated/decode-data-xml.js.map +1 -0
  41. package/lib/esm/index.d.ts +101 -0
  42. package/lib/esm/index.d.ts.map +1 -0
  43. package/lib/esm/index.js +111 -0
  44. package/lib/esm/index.js.map +1 -0
  45. package/lib/esm/maps/entities-encode.json +1 -0
  46. package/lib/esm/package.json +1 -0
  47. package/lib/generated/decode-data-html.d.ts +3 -0
  48. package/lib/generated/decode-data-html.d.ts.map +1 -0
  49. package/lib/generated/decode-data-html.js +6 -0
  50. package/lib/generated/decode-data-html.js.map +1 -0
  51. package/lib/generated/decode-data-xml.d.ts +3 -0
  52. package/lib/generated/decode-data-xml.d.ts.map +1 -0
  53. package/lib/generated/decode-data-xml.js +6 -0
  54. package/lib/generated/decode-data-xml.js.map +1 -0
  55. package/lib/index.d.ts +85 -11
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +110 -32
  58. package/lib/index.js.map +1 -0
  59. package/lib/maps/entities-encode.json +1 -0
  60. package/package.json +41 -17
  61. package/readme.md +79 -13
  62. package/lib/maps/decode.json +0 -1
  63. package/lib/maps/entities.json +0 -1
  64. package/lib/maps/legacy.json +0 -1
  65. package/lib/maps/xml.json +0 -1
package/lib/index.js CHANGED
@@ -1,57 +1,135 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0;
4
- var decode_1 = require("./decode");
5
- var encode_1 = require("./encode");
3
+ exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.DecodingMode = exports.EntityLevel = void 0;
4
+ var decode_js_1 = require("./decode.js");
5
+ var encode_js_1 = require("./encode.js");
6
+ /** The level of entities to support. */
7
+ var EntityLevel;
8
+ (function (EntityLevel) {
9
+ /** Support only XML entities. */
10
+ EntityLevel[EntityLevel["XML"] = 0] = "XML";
11
+ /** Support HTML entities, which are a superset of XML entities. */
12
+ EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
13
+ })(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {}));
14
+ /** Determines whether some entities are allowed to be written without a trailing `;`. */
15
+ var DecodingMode;
16
+ (function (DecodingMode) {
17
+ /** Support legacy HTML entities. */
18
+ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
19
+ /** Do not support legacy HTML entities. */
20
+ DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
21
+ })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {}));
22
+ var EncodingMode;
23
+ (function (EncodingMode) {
24
+ /**
25
+ * The output is UTF-8 encoded. Only characters that need escaping within
26
+ * HTML will be escaped.
27
+ */
28
+ EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
29
+ /**
30
+ * The output consists only of ASCII characters. Characters that need
31
+ * escaping within HTML, and characters that aren't ASCII characters will
32
+ * be escaped.
33
+ */
34
+ EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
35
+ /**
36
+ * Encode all characters that have an equivalent entity, as well as all
37
+ * characters that are not ASCII characters.
38
+ */
39
+ EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
40
+ /**
41
+ * Encode all characters that have to be escaped in HTML attributes,
42
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
43
+ */
44
+ EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
45
+ /**
46
+ * Encode all characters that have to be escaped in HTML text,
47
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
48
+ */
49
+ EncodingMode[EncodingMode["Text"] = 4] = "Text";
50
+ })(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {}));
6
51
  /**
7
52
  * Decodes a string with entities.
8
53
  *
9
54
  * @param data String to decode.
10
- * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
11
- * @deprecated Use `decodeXML` or `decodeHTML` directly.
55
+ * @param options Decoding options.
12
56
  */
13
- function decode(data, level) {
14
- return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
57
+ function decode(data, options) {
58
+ if (options === void 0) { options = EntityLevel.XML; }
59
+ var opts = typeof options === "number" ? { level: options } : options;
60
+ if (opts.level === EntityLevel.HTML) {
61
+ if (opts.mode === DecodingMode.Strict) {
62
+ return (0, decode_js_1.decodeHTMLStrict)(data);
63
+ }
64
+ return (0, decode_js_1.decodeHTML)(data);
65
+ }
66
+ return (0, decode_js_1.decodeXML)(data);
15
67
  }
16
68
  exports.decode = decode;
17
69
  /**
18
70
  * Decodes a string with entities. Does not allow missing trailing semicolons for entities.
19
71
  *
20
72
  * @param data String to decode.
21
- * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
22
- * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.
73
+ * @param options Decoding options.
74
+ * @deprecated Use `decode` with the `mode` set to `Strict`.
23
75
  */
24
- function decodeStrict(data, level) {
25
- return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
76
+ function decodeStrict(data, options) {
77
+ if (options === void 0) { options = EntityLevel.XML; }
78
+ var opts = typeof options === "number" ? { level: options } : options;
79
+ if (opts.level === EntityLevel.HTML) {
80
+ if (opts.mode === DecodingMode.Legacy) {
81
+ return (0, decode_js_1.decodeHTML)(data);
82
+ }
83
+ return (0, decode_js_1.decodeHTMLStrict)(data);
84
+ }
85
+ return (0, decode_js_1.decodeXML)(data);
26
86
  }
27
87
  exports.decodeStrict = decodeStrict;
28
88
  /**
29
89
  * Encodes a string with entities.
30
90
  *
31
91
  * @param data String to encode.
32
- * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.
33
- * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.
92
+ * @param options Encoding options.
34
93
  */
35
- function encode(data, level) {
36
- return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
94
+ function encode(data, options) {
95
+ if (options === void 0) { options = EntityLevel.XML; }
96
+ var opts = typeof options === "number" ? { level: options } : options;
97
+ // Mode `UTF8` just escapes XML entities
98
+ if (opts.mode === EncodingMode.UTF8)
99
+ return (0, encode_js_1.escapeUTF8)(data);
100
+ if (opts.mode === EncodingMode.Attribute)
101
+ return (0, encode_js_1.escapeAttribute)(data);
102
+ if (opts.mode === EncodingMode.Text)
103
+ return (0, encode_js_1.escapeText)(data);
104
+ if (opts.level === EntityLevel.HTML) {
105
+ if (opts.mode === EncodingMode.ASCII) {
106
+ return (0, encode_js_1.encodeNonAsciiHTML)(data);
107
+ }
108
+ return (0, encode_js_1.encodeHTML)(data);
109
+ }
110
+ // ASCII and Extensive are equivalent
111
+ return (0, encode_js_1.encodeXML)(data);
37
112
  }
38
113
  exports.encode = encode;
39
- var encode_2 = require("./encode");
40
- Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } });
41
- Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
42
- Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } });
43
- Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } });
44
- Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return encode_2.escapeUTF8; } });
114
+ var encode_js_2 = require("./encode.js");
115
+ Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_js_2.encodeXML; } });
116
+ Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
117
+ Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } });
118
+ Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_js_2.escape; } });
119
+ Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return encode_js_2.escapeUTF8; } });
120
+ Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function () { return encode_js_2.escapeAttribute; } });
121
+ Object.defineProperty(exports, "escapeText", { enumerable: true, get: function () { return encode_js_2.escapeText; } });
45
122
  // Legacy aliases (deprecated)
46
- Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
47
- Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
48
- var decode_2 = require("./decode");
49
- Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } });
50
- Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
51
- Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
123
+ Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
124
+ Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
125
+ var decode_js_2 = require("./decode.js");
126
+ Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
127
+ Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
128
+ Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
52
129
  // Legacy aliases (deprecated)
53
- Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
54
- Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
55
- Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
56
- Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
57
- Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } });
130
+ Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
131
+ Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
132
+ Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
133
+ Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
134
+ Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
135
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"\t":"Tab","\n":"NewLine","!":"excl","\"":"quot","#":"num","$":"dollar","%":"percnt","&":"amp","'":"apos","(":"lpar",")":"rpar","*":"midast","+":"plus",",":"comma",".":"period","/":"sol",":":"colon",";":"semi","<":"lt","<⃒":"nvlt","=":"equals","=⃥":"bne",">":"gt",">⃒":"nvgt","?":"quest","@":"commat","[":"lsqb","\\":"bsol","]":"rsqb","^":"Hat","_":"lowbar","`":"grave","fj":"fjlig","{":"lcub","|":"vert","}":"rcub"," ":"nbsp","¡":"iexcl","¢":"cent","£":"pound","¤":"curren","¥":"yen","¦":"brvbar","§":"sect","¨":"uml","©":"copy","ª":"ordf","«":"laquo","¬":"not","­":"shy","®":"reg","¯":"strns","°":"deg","±":"pm","²":"sup2","³":"sup3","´":"acute","µ":"micro","¶":"para","·":"middot","¸":"cedil","¹":"sup1","º":"ordm","»":"raquo","¼":"frac14","½":"half","¾":"frac34","¿":"iquest","À":"Agrave","Á":"Aacute","Â":"Acirc","Ã":"Atilde","Ä":"Auml","Å":"angst","Æ":"AElig","Ç":"Ccedil","È":"Egrave","É":"Eacute","Ê":"Ecirc","Ë":"Euml","Ì":"Igrave","Í":"Iacute","Î":"Icirc","Ï":"Iuml","Ð":"ETH","Ñ":"Ntilde","Ò":"Ograve","Ó":"Oacute","Ô":"Ocirc","Õ":"Otilde","Ö":"Ouml","×":"times","Ø":"Oslash","Ù":"Ugrave","Ú":"Uacute","Û":"Ucirc","Ü":"Uuml","Ý":"Yacute","Þ":"THORN","ß":"szlig","à":"agrave","á":"aacute","â":"acirc","ã":"atilde","ä":"auml","å":"aring","æ":"aelig","ç":"ccedil","è":"egrave","é":"eacute","ê":"ecirc","ë":"euml","ì":"igrave","í":"iacute","î":"icirc","ï":"iuml","ð":"eth","ñ":"ntilde","ò":"ograve","ó":"oacute","ô":"ocirc","õ":"otilde","ö":"ouml","÷":"divide","ø":"oslash","ù":"ugrave","ú":"uacute","û":"ucirc","ü":"uuml","ý":"yacute","þ":"thorn","ÿ":"yuml","Ā":"Amacr","ā":"amacr","Ă":"Abreve","ă":"abreve","Ą":"Aogon","ą":"aogon","Ć":"Cacute","ć":"cacute","Ĉ":"Ccirc","ĉ":"ccirc","Ċ":"Cdot","ċ":"cdot","Č":"Ccaron","č":"ccaron","Ď":"Dcaron","ď":"dcaron","Đ":"Dstrok","đ":"dstrok","Ē":"Emacr","ē":"emacr","Ė":"Edot","ė":"edot","Ę":"Eogon","ę":"eogon","Ě":"Ecaron","ě":"ecaron","Ĝ":"Gcirc","ĝ":"gcirc","Ğ":"Gbreve","ğ":"gbreve","Ġ":"Gdot","ġ":"gdot","Ģ":"Gcedil","Ĥ":"Hcirc","ĥ":"hcirc","Ħ":"Hstrok","ħ":"hstrok","Ĩ":"Itilde","ĩ":"itilde","Ī":"Imacr","ī":"imacr","Į":"Iogon","į":"iogon","İ":"Idot","ı":"inodot","IJ":"IJlig","ij":"ijlig","Ĵ":"Jcirc","ĵ":"jcirc","Ķ":"Kcedil","ķ":"kcedil","ĸ":"kgreen","Ĺ":"Lacute","ĺ":"lacute","Ļ":"Lcedil","ļ":"lcedil","Ľ":"Lcaron","ľ":"lcaron","Ŀ":"Lmidot","ŀ":"lmidot","Ł":"Lstrok","ł":"lstrok","Ń":"Nacute","ń":"nacute","Ņ":"Ncedil","ņ":"ncedil","Ň":"Ncaron","ň":"ncaron","ʼn":"napos","Ŋ":"ENG","ŋ":"eng","Ō":"Omacr","ō":"omacr","Ő":"Odblac","ő":"odblac","Œ":"OElig","œ":"oelig","Ŕ":"Racute","ŕ":"racute","Ŗ":"Rcedil","ŗ":"rcedil","Ř":"Rcaron","ř":"rcaron","Ś":"Sacute","ś":"sacute","Ŝ":"Scirc","ŝ":"scirc","Ş":"Scedil","ş":"scedil","Š":"Scaron","š":"scaron","Ţ":"Tcedil","ţ":"tcedil","Ť":"Tcaron","ť":"tcaron","Ŧ":"Tstrok","ŧ":"tstrok","Ũ":"Utilde","ũ":"utilde","Ū":"Umacr","ū":"umacr","Ŭ":"Ubreve","ŭ":"ubreve","Ů":"Uring","ů":"uring","Ű":"Udblac","ű":"udblac","Ų":"Uogon","ų":"uogon","Ŵ":"Wcirc","ŵ":"wcirc","Ŷ":"Ycirc","ŷ":"ycirc","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ż":"Zdot","ż":"zdot","Ž":"Zcaron","ž":"zcaron","ƒ":"fnof","Ƶ":"imped","ǵ":"gacute","ȷ":"jmath","ˆ":"circ","ˇ":"caron","˘":"breve","˙":"dot","˚":"ring","˛":"ogon","˜":"tilde","˝":"dblac","̑":"DownBreve","Α":"Alpha","Β":"Beta","Γ":"Gamma","Δ":"Delta","Ε":"Epsilon","Ζ":"Zeta","Η":"Eta","Θ":"Theta","Ι":"Iota","Κ":"Kappa","Λ":"Lambda","Μ":"Mu","Ν":"Nu","Ξ":"Xi","Ο":"Omicron","Π":"Pi","Ρ":"Rho","Σ":"Sigma","Τ":"Tau","Υ":"Upsilon","Φ":"Phi","Χ":"Chi","Ψ":"Psi","Ω":"ohm","α":"alpha","β":"beta","γ":"gamma","δ":"delta","ε":"epsilon","ζ":"zeta","η":"eta","θ":"theta","ι":"iota","κ":"kappa","λ":"lambda","μ":"mu","ν":"nu","ξ":"xi","ο":"omicron","π":"pi","ρ":"rho","ς":"varsigma","σ":"sigma","τ":"tau","υ":"upsilon","φ":"phi","χ":"chi","ψ":"psi","ω":"omega","ϑ":"vartheta","ϒ":"upsih","ϕ":"varphi","ϖ":"varpi","Ϝ":"Gammad","ϝ":"gammad","ϰ":"varkappa","ϱ":"varrho","ϵ":"varepsilon","϶":"bepsi","Ё":"IOcy","Ђ":"DJcy","Ѓ":"GJcy","Є":"Jukcy","Ѕ":"DScy","І":"Iukcy","Ї":"YIcy","Ј":"Jsercy","Љ":"LJcy","Њ":"NJcy","Ћ":"TSHcy","Ќ":"KJcy","Ў":"Ubrcy","Џ":"DZcy","А":"Acy","Б":"Bcy","В":"Vcy","Г":"Gcy","Д":"Dcy","Е":"IEcy","Ж":"ZHcy","З":"Zcy","И":"Icy","Й":"Jcy","К":"Kcy","Л":"Lcy","М":"Mcy","Н":"Ncy","О":"Ocy","П":"Pcy","Р":"Rcy","С":"Scy","Т":"Tcy","У":"Ucy","Ф":"Fcy","Х":"KHcy","Ц":"TScy","Ч":"CHcy","Ш":"SHcy","Щ":"SHCHcy","Ъ":"HARDcy","Ы":"Ycy","Ь":"SOFTcy","Э":"Ecy","Ю":"YUcy","Я":"YAcy","а":"acy","б":"bcy","в":"vcy","г":"gcy","д":"dcy","е":"iecy","ж":"zhcy","з":"zcy","и":"icy","й":"jcy","к":"kcy","л":"lcy","м":"mcy","н":"ncy","о":"ocy","п":"pcy","р":"rcy","с":"scy","т":"tcy","у":"ucy","ф":"fcy","х":"khcy","ц":"tscy","ч":"chcy","ш":"shcy","щ":"shchcy","ъ":"hardcy","ы":"ycy","ь":"softcy","э":"ecy","ю":"yucy","я":"yacy","ё":"iocy","ђ":"djcy","ѓ":"gjcy","є":"jukcy","ѕ":"dscy","і":"iukcy","ї":"yicy","ј":"jsercy","љ":"ljcy","њ":"njcy","ћ":"tshcy","ќ":"kjcy","ў":"ubrcy","џ":"dzcy"," ":"ensp"," ":"emsp"," ":"emsp13"," ":"emsp14"," ":"numsp"," ":"puncsp"," ":"thinsp"," ":"hairsp","​":"ZeroWidthSpace","‌":"zwnj","‍":"zwj","‎":"lrm","‏":"rlm","‐":"hyphen","–":"ndash","—":"mdash","―":"horbar","‖":"Vert","‘":"lsquo","’":"rsquor","‚":"sbquo","“":"ldquo","”":"rdquor","„":"ldquor","†":"dagger","‡":"ddagger","•":"bullet","‥":"nldr","…":"mldr","‰":"permil","‱":"pertenk","′":"prime","″":"Prime","‴":"tprime","‵":"bprime","‹":"lsaquo","›":"rsaquo","‾":"oline","⁁":"caret","⁃":"hybull","⁄":"frasl","⁏":"bsemi","⁗":"qprime"," ":"MediumSpace","  ":"ThickSpace","⁠":"NoBreak","⁡":"af","⁢":"it","⁣":"ic","€":"euro","⃛":"tdot","⃜":"DotDot","ℂ":"complexes","℅":"incare","ℊ":"gscr","ℋ":"hamilt","ℌ":"Poincareplane","ℍ":"quaternions","ℎ":"planckh","ℏ":"plankv","ℐ":"imagline","ℑ":"imagpart","ℒ":"lagran","ℓ":"ell","ℕ":"naturals","№":"numero","℗":"copysr","℘":"wp","ℙ":"primes","ℚ":"rationals","ℛ":"realine","ℜ":"realpart","ℝ":"reals","℞":"rx","™":"trade","ℤ":"integers","℧":"mho","ℨ":"zeetrf","℩":"iiota","ℬ":"bernou","ℭ":"Cfr","ℯ":"escr","ℰ":"expectation","ℱ":"Fscr","ℳ":"phmmat","ℴ":"oscr","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth","ⅅ":"DD","ⅆ":"dd","ⅇ":"exponentiale","ⅈ":"ii","⅓":"frac13","⅔":"frac23","⅕":"frac15","⅖":"frac25","⅗":"frac35","⅘":"frac45","⅙":"frac16","⅚":"frac56","⅛":"frac18","⅜":"frac38","⅝":"frac58","⅞":"frac78","←":"slarr","↑":"uparrow","→":"srarr","↓":"downarrow","↔":"leftrightarrow","↕":"varr","↖":"nwarrow","↗":"nearrow","↘":"searrow","↙":"swarrow","↚":"nleftarrow","↛":"nrightarrow","↝":"rightsquigarrow","↝̸":"nrarrw","↞":"twoheadleftarrow","↟":"Uarr","↠":"twoheadrightarrow","↡":"Darr","↢":"leftarrowtail","↣":"rightarrowtail","↤":"mapstoleft","↥":"mapstoup","↦":"mapsto","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"looparrowleft","↬":"rarrlp","↭":"leftrightsquigarrow","↮":"nleftrightarrow","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"curvearrowleft","↷":"curvearrowright","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"upharpoonright","↿":"upharpoonleft","⇀":"rightharpoonup","⇁":"rightharpoondown","⇂":"downharpoonright","⇃":"downharpoonleft","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"downdownarrows","⇋":"lrhar","⇌":"rlhar","⇍":"nlArr","⇎":"nhArr","⇏":"nrArr","⇐":"lArr","⇑":"uArr","⇒":"rArr","⇓":"dArr","⇔":"iff","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"complement","∂":"part","∂̸":"npart","∃":"exist","∄":"nexists","∅":"varnothing","∇":"nabla","∈":"isinv","∉":"notinva","∋":"niv","∌":"notniva","∏":"prod","∐":"coprod","∑":"sum","−":"minus","∓":"mp","∔":"plusdo","∖":"ssetmn","∗":"lowast","∘":"compfn","√":"radic","∝":"vprop","∞":"infin","∟":"angrt","∠":"angle","∠⃒":"nang","∡":"measuredangle","∢":"angsph","∣":"smid","∤":"nsmid","∥":"spar","∦":"nspar","∧":"wedge","∨":"vee","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","∮":"oint","∯":"DoubleContourIntegral","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"therefore","∵":"because","∶":"ratio","∷":"Proportion","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"thksim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"mstpos","∾̳":"acE","∿":"acd","≀":"wreath","≁":"nsim","≂":"esim","≂̸":"nesim","≃":"simeq","≄":"nsimeq","≅":"cong","≆":"simne","≇":"ncong","≈":"thkap","≉":"napprox","≊":"approxeq","≋":"apid","≋̸":"napid","≌":"bcong","≍":"asympeq","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpeq","≏̸":"nbumpe","≐":"esdot","≐̸":"nedot","≑":"eDot","≒":"fallingdotseq","≓":"risingdotseq","≔":"coloneq","≕":"eqcolon","≖":"eqcirc","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"questeq","≠":"ne","≡":"equiv","≡⃥":"bnequiv","≢":"nequiv","≤":"leq","≤⃒":"nvle","≥":"geq","≥⃒":"nvge","≦":"leqq","≦̸":"nleqq","≧":"geqq","≧̸":"ngeqq","≨":"lneqq","≨︀":"lvnE","≩":"gneqq","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≭":"NotCupCap","≮":"nlt","≯":"ngtr","≰":"nleq","≱":"ngeq","≲":"lsim","≳":"gtrsim","≴":"nlsim","≵":"ngsim","≶":"lg","≷":"gtrless","≸":"ntlg","≹":"ntgl","≺":"prec","≻":"succ","≼":"preccurlyeq","≽":"succcurlyeq","≾":"prsim","≿":"succsim","≿̸":"NotSucceedsTilde","⊀":"nprec","⊁":"nsucc","⊂":"subset","⊂⃒":"vnsub","⊃":"supset","⊃⃒":"vnsup","⊄":"nsub","⊅":"nsup","⊆":"subseteq","⊇":"supseteq","⊈":"nsubseteq","⊉":"nsupseteq","⊊":"subsetneq","⊊︀":"vsubne","⊋":"supsetneq","⊋︀":"vsupne","⊍":"cupdot","⊎":"uplus","⊏":"sqsubset","⊏̸":"NotSquareSubset","⊐":"sqsupset","⊐̸":"NotSquareSuperset","⊑":"sqsubseteq","⊒":"sqsupseteq","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊣":"dashv","⊤":"top","⊥":"perp","⊧":"models","⊨":"vDash","⊩":"Vdash","⊪":"Vvdash","⊫":"VDash","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⊳":"vrtri","⊴":"trianglelefteq","⊴⃒":"nvltrie","⊵":"trianglerighteq","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intercal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"xwedge","⋁":"xvee","⋂":"xcap","⋃":"xcup","⋄":"diamond","⋅":"sdot","⋆":"sstarf","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Subset","⋑":"Supset","⋒":"Cap","⋓":"Cup","⋔":"pitchfork","⋕":"epar","⋖":"ltdot","⋗":"gtrdot","⋘":"Ll","⋘̸":"nLl","⋙":"ggg","⋙̸":"nGg","⋚":"lesseqgtr","⋚︀":"lesg","⋛":"gtreqless","⋛︀":"gesl","⋞":"curlyeqprec","⋟":"curlyeqsucc","⋠":"nprcue","⋡":"nsccue","⋢":"nsqsube","⋣":"nsqsupe","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"succnsim","⋪":"ntriangleleft","⋫":"ntriangleright","⋬":"ntrianglelefteq","⋭":"ntrianglerighteq","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwedge","⌆":"doublebarwedge","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorner","⌝":"urcorner","⌞":"llcorner","⌟":"lrcorner","⌢":"sfrown","⌣":"ssmile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoustache","⎱":"rmoustache","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","Ⓢ":"oS","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"square","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"triangleright","▽":"xdtri","▾":"dtrif","▿":"triangledown","◂":"ltrif","◃":"triangleleft","◊":"lozenge","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spadesuit","♣":"clubsuit","♥":"heartsuit","♦":"diams","♪":"sung","♭":"flat","♮":"natural","♯":"sharp","✓":"checkmark","✗":"cross","✠":"maltese","✶":"sext","❘":"VerticalSeparator","❲":"lbbrk","❳":"rbbrk","⟈":"bsolhsub","⟉":"suphsol","⟦":"lobrk","⟧":"robrk","⟨":"langle","⟩":"rangle","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"drbkarow","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨌":"qint","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩴":"Colone","⩵":"Equal","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lessapprox","⪆":"gtrapprox","⪇":"lneq","⪈":"gneq","⪉":"lnapprox","⪊":"gnapprox","⪋":"lesseqqgtr","⪌":"gtreqqless","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"eqslantless","⪖":"eqslantgtr","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"preceq","⪯̸":"npreceq","⪰":"succeq","⪰̸":"nsucceq","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"succneqq","⪷":"precapprox","⪸":"succapprox","⪹":"prnap","⪺":"succnapprox","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subseteqq","⫅̸":"nsubseteqq","⫆":"supseteqq","⫆̸":"nsupseteqq","⫇":"subsim","⫈":"supsim","⫋":"subsetneqq","⫋︀":"vsubnE","⫌":"supsetneqq","⫌︀":"vsupnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"DoubleLeftTee","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","ff":"fflig","fi":"filig","fl":"fllig","ffi":"ffilig","ffl":"ffllig","𝒜":"Ascr","𝒞":"Cscr","𝒟":"Dscr","𝒢":"Gscr","𝒥":"Jscr","𝒦":"Kscr","𝒩":"Nscr","𝒪":"Oscr","𝒫":"Pscr","𝒬":"Qscr","𝒮":"Sscr","𝒯":"Tscr","𝒰":"Uscr","𝒱":"Vscr","𝒲":"Wscr","𝒳":"Xscr","𝒴":"Yscr","𝒵":"Zscr","𝒶":"ascr","𝒷":"bscr","𝒸":"cscr","𝒹":"dscr","𝒻":"fscr","𝒽":"hscr","𝒾":"iscr","𝒿":"jscr","𝓀":"kscr","𝓁":"lscr","𝓂":"mscr","𝓃":"nscr","𝓅":"pscr","𝓆":"qscr","𝓇":"rscr","𝓈":"sscr","𝓉":"tscr","𝓊":"uscr","𝓋":"vscr","𝓌":"wscr","𝓍":"xscr","𝓎":"yscr","𝓏":"zscr","𝔄":"Afr","𝔅":"Bfr","𝔇":"Dfr","𝔈":"Efr","𝔉":"Ffr","𝔊":"Gfr","𝔍":"Jfr","𝔎":"Kfr","𝔏":"Lfr","𝔐":"Mfr","𝔑":"Nfr","𝔒":"Ofr","𝔓":"Pfr","𝔔":"Qfr","𝔖":"Sfr","𝔗":"Tfr","𝔘":"Ufr","𝔙":"Vfr","𝔚":"Wfr","𝔛":"Xfr","𝔜":"Yfr","𝔞":"afr","𝔟":"bfr","𝔠":"cfr","𝔡":"dfr","𝔢":"efr","𝔣":"ffr","𝔤":"gfr","𝔥":"hfr","𝔦":"ifr","𝔧":"jfr","𝔨":"kfr","𝔩":"lfr","𝔪":"mfr","𝔫":"nfr","𝔬":"ofr","𝔭":"pfr","𝔮":"qfr","𝔯":"rfr","𝔰":"sfr","𝔱":"tfr","𝔲":"ufr","𝔳":"vfr","𝔴":"wfr","𝔵":"xfr","𝔶":"yfr","𝔷":"zfr","𝔸":"Aopf","𝔹":"Bopf","𝔻":"Dopf","𝔼":"Eopf","𝔽":"Fopf","𝔾":"Gopf","𝕀":"Iopf","𝕁":"Jopf","𝕂":"Kopf","𝕃":"Lopf","𝕄":"Mopf","𝕆":"Oopf","𝕊":"Sopf","𝕋":"Topf","𝕌":"Uopf","𝕍":"Vopf","𝕎":"Wopf","𝕏":"Xopf","𝕐":"Yopf","𝕒":"aopf","𝕓":"bopf","𝕔":"copf","𝕕":"dopf","𝕖":"eopf","𝕗":"fopf","𝕘":"gopf","𝕙":"hopf","𝕚":"iopf","𝕛":"jopf","𝕜":"kopf","𝕝":"lopf","𝕞":"mopf","𝕟":"nopf","𝕠":"oopf","𝕡":"popf","𝕢":"qopf","𝕣":"ropf","𝕤":"sopf","𝕥":"topf","𝕦":"uopf","𝕧":"vopf","𝕨":"wopf","𝕩":"xopf","𝕪":"yopf","𝕫":"zopf"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "entities",
3
- "version": "2.2.0",
4
- "description": "Encode & decode XML and HTML entities with ease",
3
+ "version": "4.0.0",
4
+ "description": "Encode & decode XML and HTML entities with ease & speed",
5
5
  "author": "Felix Boehm <me@feedic.com>",
6
6
  "funding": "https://github.com/fb55/entities?sponsor=1",
7
7
  "sideEffects": false,
@@ -18,26 +18,40 @@
18
18
  },
19
19
  "main": "lib/index.js",
20
20
  "types": "lib/index.d.ts",
21
+ "module": "lib/esm/index.js",
22
+ "exports": {
23
+ ".": {
24
+ "require": "./lib/index.js",
25
+ "import": "./lib/esm/index.js"
26
+ },
27
+ "./lib/decode.js": {
28
+ "require": "./lib/decode.js",
29
+ "import": "./lib/esm/decode.js"
30
+ }
31
+ },
21
32
  "files": [
22
33
  "lib/**/*"
23
34
  ],
35
+ "engines": {
36
+ "node": ">=0.12"
37
+ },
24
38
  "devDependencies": {
25
- "@types/jest": "^26.0.0",
26
- "@types/node": "^14.11.8",
27
- "@typescript-eslint/eslint-plugin": "^4.4.1",
28
- "@typescript-eslint/parser": "^4.4.1",
29
- "coveralls": "*",
30
- "eslint": "^7.11.0",
31
- "eslint-config-prettier": "^7.0.0",
39
+ "@types/jest": "^27.4.1",
40
+ "@types/node": "^17.0.23",
41
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
42
+ "@typescript-eslint/parser": "^5.17.0",
43
+ "eslint": "^8.12.0",
44
+ "eslint-config-prettier": "^8.5.0",
32
45
  "eslint-plugin-node": "^11.1.0",
33
- "jest": "^26.5.3",
34
- "prettier": "^2.0.5",
35
- "ts-jest": "^26.1.0",
36
- "typescript": "^4.0.2"
46
+ "jest": "^27.5.1",
47
+ "prettier": "^2.6.1",
48
+ "ts-jest": "^27.1.4",
49
+ "typedoc": "^0.22.13",
50
+ "typescript": "^4.6.3"
37
51
  },
38
52
  "scripts": {
39
- "test": "jest --coverage && npm run lint",
40
- "coverage": "cat coverage/lcov.info | coveralls",
53
+ "test": "npm run test:jest && npm run lint",
54
+ "test:jest": "jest",
41
55
  "lint": "npm run lint:es && npm run lint:prettier",
42
56
  "lint:es": "eslint .",
43
57
  "lint:prettier": "npm run prettier -- --check",
@@ -45,7 +59,13 @@
45
59
  "format:es": "npm run lint:es -- --fix",
46
60
  "format:prettier": "npm run prettier -- --write",
47
61
  "prettier": "prettier '**/*.{ts,md,json,yml}'",
48
- "build": "tsc && cp -r src/maps lib",
62
+ "build": "npm run build:cjs && npm run build:esm",
63
+ "build:cjs": "tsc && cp -r src/maps lib",
64
+ "build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && npm rum build:esm:fixup && echo '{\"type\":\"module\"}' > lib/esm/package.json",
65
+ "build:esm:fixup": "sed -i.b '1s|\".*json\"|\"../maps/entities-encode.json\" assert {type:\"json\"}|' lib/esm/encode-trie.js && rm lib/esm/encode-trie.js.b",
66
+ "build:docs": "typedoc --hideGenerator src/index.ts",
67
+ "build:trie": "ts-node scripts/write-decode-map.ts",
68
+ "build:encode-map": "jq -c 'to_entries | reverse | map( {(.value) : .key } ) | sort | add' maps/entities.json > src/maps/entities-encode.json",
49
69
  "prepare": "npm run build"
50
70
  },
51
71
  "repository": {
@@ -55,7 +75,11 @@
55
75
  "license": "BSD-2-Clause",
56
76
  "jest": {
57
77
  "preset": "ts-jest",
58
- "testEnvironment": "node"
78
+ "testEnvironment": "node",
79
+ "coverageProvider": "v8",
80
+ "moduleNameMapper": {
81
+ "^(.*)\\.js$": "$1"
82
+ }
59
83
  },
60
84
  "prettier": {
61
85
  "tabWidth": 4,
package/readme.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  Encode & decode HTML & XML entities with ease & speed.
4
4
 
5
+ ## Features
6
+
7
+ - ⚔️ Battle tested: `entities` is used by many popular libraries; eg.
8
+ [`htmlparser2`](https://github.com/fb55/htmlparser2), the official
9
+ [AWS SDK](https://github.com/aws/aws-sdk-js-v3) and
10
+ [`commonmark`](https://github.com/commonmark/commonmark.js) use it to
11
+ process HTML entities.
12
+ - ⚡️ Fast: `entities` is the fastes library for decoding HTML entities (as of
13
+ August 2021); see [performance](#performance).
14
+ - 🎛 Configurable: Get an output tailored for your needs. You are fine with
15
+ UTF8? That'll safe you some bytes. Prefer to only have ASCII characters? We
16
+ can do that as well!
17
+
5
18
  ## How to…
6
19
 
7
20
  ### …install `entities`
@@ -13,12 +26,12 @@ Encode & decode HTML & XML entities with ease & speed.
13
26
  ```javascript
14
27
  const entities = require("entities");
15
28
 
16
- //encoding
17
- entities.escape("&#38;"); // "&#x26;#38;"
18
- entities.encodeXML("&#38;"); // "&amp;#38;"
19
- entities.encodeHTML("&#38;"); // "&amp;&num;38&semi;"
29
+ // Encoding
30
+ entities.escapeUTF8("&#38; ü"); // "&amp;#38; ü"
31
+ entities.encodeXML("&#38; ü"); // "&amp;#38; &#xfc;"
32
+ entities.encodeHTML("&#38; ü"); // "&amp;&num;38&semi; &uuml;"
20
33
 
21
- //decoding
34
+ // Decoding
22
35
  entities.decodeXML("asdf &amp; &#xFF; &#xFC; &apos;"); // "asdf & ÿ ü '"
23
36
  entities.decodeHTML("asdf &amp; &yuml; &uuml; &apos;"); // "asdf & ÿ ü '"
24
37
  ```
@@ -26,14 +39,67 @@ entities.decodeHTML("asdf &amp; &yuml; &uuml; &apos;"); // "asdf & ÿ ü '"
26
39
  ## Performance
27
40
 
28
41
  This is how `entities` compares to other libraries on a very basic benchmark
29
- (see `scripts/benchmark.ts`, for 10,000,000 iterations):
30
-
31
- | Library | `decode` performance | `encode` performance | Bundle size |
32
- | -------------- | -------------------- | -------------------- | -------------------------------------------------------------------------- |
33
- | entities | 10.809s | 17.683s | ![npm bundle size](https://img.shields.io/bundlephobia/min/entities) |
34
- | html-entities | 14.029s | 22.670s | ![npm bundle size](https://img.shields.io/bundlephobia/min/html-entities) |
35
- | he | 16.163s | 44.010s | ![npm bundle size](https://img.shields.io/bundlephobia/min/he) |
36
- | parse-entities | 28.507s | N/A | ![npm bundle size](https://img.shields.io/bundlephobia/min/parse-entities) |
42
+ (see `scripts/benchmark.ts`, for 10,000,000 iterations; **lower is better**):
43
+
44
+ | Library | Version | `decode` perf | `encode` perf | `escape` perf |
45
+ | -------------- | ------- | ------------- | ------------- | ------------- |
46
+ | entities | `3.0.1` | 1.418s | 6.786s | 2.196s |
47
+ | html-entities | `2.3.2` | 2.530s | 6.829s | 2.415s |
48
+ | he | `1.2.0` | 5.800s | 24.237s | 3.624s |
49
+ | parse-entities | `3.0.0` | 9.660s | N/A | N/A |
50
+
51
+ ---
52
+
53
+ ## FAQ
54
+
55
+ > What methods should I actually use to encode my documents?
56
+
57
+ If your target supports UTF-8, the `escapeUTF8` method is going to be your best
58
+ choice. Otherwise, use either `encodeHTML` or `encodeXML` based on whether
59
+ you're dealing with an HTML or an XML document.
60
+
61
+ You can have a look at the options for the `encode` and `decode` methods to see
62
+ everything you can configure.
63
+
64
+ > When should I use strict decoding?
65
+
66
+ Strict decoding is for decoding entities in attributes, as well as in legacy
67
+ environments. When strict decoding, entities not terminated with a semicolon
68
+ will be ignored.
69
+
70
+ > Why should I use `entities` instead of alternative modules?
71
+
72
+ As of August 2021, `entities` is a bit faster than other modules. Still, this is
73
+ not a very differentiated space and other modules can catch up.
74
+
75
+ **More importantly**, you might already have `entities` in your dependency graph
76
+ (as a dependency of eg. `cheerio`, or `htmlparser2`), and including it directly
77
+ might not even increase your bundle size. The same is true for other entity
78
+ libraries, so have a look through your `node_modules` directory!
79
+
80
+ > Does `entities` support tree shaking?
81
+
82
+ This depends on your bundler, but yes, it should! Eg. recent versions of Webpack
83
+ are able to tree-shake commonjs projects, and having the `sideEffects` flag in
84
+ the `package.json` set to `false` means that your bundles should be much
85
+ smaller.
86
+
87
+ ---
88
+
89
+ ## Acknowledgements
90
+
91
+ This libary wouldn't be possible without the work of these individuals. Thanks
92
+ to
93
+
94
+ - [@mathiasbynens](https://github.com/mathiasbynens) for his explanations
95
+ about character encodings, and his library `he`, which was one of the
96
+ inspirations for `entities`
97
+ - [@inikulin](https://github.com/inikulin) for his work on optimized tries for
98
+ decoding HTML entities for the `parse5` project
99
+ - [@mdevils](https://github.com/mdevils) for taking on the challenge of
100
+ producing a quick entity library with his `html-entities` library.
101
+ `entities` would be quite a bit slower if there wasn't any competition.
102
+ Right now `entities` is on top, but we'll see how long that lasts!
37
103
 
38
104
  ---
39
105
 
@@ -1 +0,0 @@
1
- {"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}