htmlmin 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,7 +8,7 @@ Please report issues on [Github] (https://github.com/aishek/htmlmin/issues).
8
8
 
9
9
  For feedback, suggestions, etc. write to <aishek@gmail.com>.
10
10
 
11
- **Important**: this project is in beta and may contain bugs. Current version: 0.0.4
11
+ **Important**: this project is in beta and may contain bugs. Current version: 0.0.5
12
12
 
13
13
  # Installation
14
14
 
@@ -24,8 +24,13 @@ Usage:
24
24
  options = {
25
25
  :remove_comments => true,
26
26
  :remove_conditional_comments => true, # only downlevel-hidden conditional comments e.g. <!--[if expression]> HTML <![endif]-->
27
+
27
28
  :minify_whitespaces => true,
28
- :max_line_len => 32768, # 0 - disable this safety feature
29
+
30
+ :max_line_len => 32768, # 0 - disable this safety feature
31
+
32
+ :minify_entities => true, # e.g. &#173; => &shy;
33
+ :entities_to_chars => true, # e.g. &copy; => ©
29
34
  }
30
35
  minified_html = HTMLMin.minify(html, options)
31
36
 
@@ -34,6 +39,8 @@ Usage:
34
39
  * Insert newline after DOCTYPE declaration
35
40
  * Removal of whitespace
36
41
  * Removal of comments
42
+ * Minification of HTML entities
43
+ * Replace HTML entities by equal chars
37
44
 
38
45
  # Development roadmap
39
46
 
@@ -46,8 +53,8 @@ Usage:
46
53
  * ~~Keep lines not longer that 30k (config option)~~
47
54
  * Do not perform minify in script and style tag's content
48
55
  * Do not perform minify in code, samp, pre tags's content
49
- * Replace entities with numeric entities for shorter strings
50
- * Replace entities with characters for shorter strings
56
+ * ~~Replace entities with numeric entities for shorter strings~~
57
+ * ~~Replace entities with characters for shorter strings~~
51
58
  * Minify shorttag close symbol
52
59
  * Minify shorttag close whitespace
53
60
  * Replace http:// with // in href and src attributes
@@ -19,16 +19,20 @@ module HTMLMin
19
19
  extend HTMLMin::SlotMachines::Common
20
20
  extend HTMLMin::SlotMachines::Comment
21
21
  extend HTMLMin::SlotMachines::Doctype
22
+ extend HTMLMin::SlotMachines::Entity
22
23
  extend HTMLMin::SlotMachines::Tag
23
24
 
24
25
  class << self
25
26
 
26
27
  DEFAULT_OPTIONS = {
27
28
  :remove_comments => true,
28
- :preserve_conditional_comments => true,
29
+ :remove_conditional_comments => true,
29
30
 
30
31
  :minify_whitespaces => true,
31
32
 
33
+ :minify_entities => true,
34
+ :entities_to_chars => true,
35
+
32
36
  :max_line_len => 32768, # 32k - safety feature
33
37
 
34
38
  :debug => false
@@ -19,6 +19,17 @@ module HTMLMin
19
19
  clear_buffer
20
20
  end
21
21
 
22
+ def buffer_value
23
+ @result_buffer.join
24
+ end
25
+
26
+ def replace_buffer_by(chars)
27
+ clear_buffer
28
+ chars.each_char do |char|
29
+ add_to_buffer char
30
+ end
31
+ end
32
+
22
33
  def unshift_spaces_from_buffer
23
34
  @result_buffer = @result_buffer.drop_while {|char| char == ' '} if @settings[:minify_whitespaces]
24
35
  end
@@ -1,4 +1,5 @@
1
1
  require 'htmlmin/slot_machines/common'
2
2
  require 'htmlmin/slot_machines/comment'
3
3
  require 'htmlmin/slot_machines/doctype'
4
- require 'htmlmin/slot_machines/tag'
4
+ require 'htmlmin/slot_machines/tag'
5
+ require 'htmlmin/slot_machines/entity'
@@ -70,6 +70,12 @@ module HTMLMin
70
70
  when "<"
71
71
  flush_buffer if saved_state_empty?
72
72
  change_state_to_tag_or_tagend_or_comment_or_doctype_begin char
73
+ when '&'
74
+ reset_saved_state
75
+ flush_buffer
76
+
77
+ add_to_buffer char
78
+ change_state_to :entity
73
79
  when HTMLMin::Minifier::END_OF_FILE
74
80
  flush_buffer
75
81
  else
@@ -87,6 +93,9 @@ module HTMLMin
87
93
  change_state_to_spaces char
88
94
  when "<"
89
95
  change_state_to_tag_or_tagend_or_comment_or_doctype_begin char
96
+ when '&'
97
+ add_to_buffer char
98
+ change_state_to :entity
90
99
  when HTMLMin::Minifier::END_OF_FILE
91
100
  flush_buffer
92
101
  else
@@ -104,6 +113,9 @@ module HTMLMin
104
113
  change_state_to_spaces char
105
114
  when "<"
106
115
  change_state_to_tag_or_tagend_or_comment_or_doctype_begin char
116
+ when '&'
117
+ add_to_buffer char
118
+ change_state_to :entity
107
119
  else
108
120
  add_to_result char
109
121
  change_state_to :start
@@ -0,0 +1,1140 @@
1
+ # encoding: utf-8
2
+ module HTMLMin
3
+
4
+ module SlotMachines
5
+
6
+ module Entity
7
+
8
+ private
9
+
10
+ def entity(char)
11
+ case char
12
+ when 'a'..'z', 'A'..'Z', '0'..'9', '#'
13
+ add_to_buffer char
14
+ when ';'
15
+ add_to_buffer char
16
+
17
+ process_entity
18
+ flush_buffer
19
+
20
+ change_state_to :start
21
+ when "\s", "\n", "\r", "\t"
22
+ flush_buffer
23
+ change_state_to_spaces char
24
+ when "<"
25
+ flush_buffer
26
+ change_state_to_tag_or_tagend_or_comment_or_doctype_begin char
27
+ when '&'
28
+ flush_buffer
29
+
30
+ add_to_buffer char
31
+ change_state_to :entity
32
+ when HTMLMin::Minifier::END_OF_FILE
33
+ flush_buffer
34
+ else
35
+ flush_buffer
36
+
37
+ add_to_result char
38
+ change_state_to :start
39
+ end
40
+ end
41
+
42
+ def process_entity
43
+ minify_entity if @settings[:minify_entities]
44
+ entity_to_char if @settings[:entities_to_chars]
45
+ end
46
+
47
+ def minify_entity
48
+ entity = MINIFIED_ENTITY[buffer_value]
49
+ replace_buffer_by entity unless entity.nil?
50
+ end
51
+
52
+ def entity_to_char
53
+ char = ENTITY_SYMBOL[buffer_value]
54
+ replace_buffer_by char unless char.nil?
55
+ end
56
+
57
+ ENTITY_SYMBOL = {
58
+ '&iexcl;' => '¡',
59
+ '&#161;' => '¡',
60
+ '&#xA1;' => '¡',
61
+ '&cent;' => '¢',
62
+ '&#162;' => '¢',
63
+ '&#xA2;' => '¢',
64
+ '&pound;' => '£',
65
+ '&#163;' => '£',
66
+ '&#xA3;' => '£',
67
+ '&curren;' => '¤',
68
+ '&#164;' => '¤',
69
+ '&#xA4;' => '¤',
70
+ '&yen;' => '¥',
71
+ '&#165;' => '¥',
72
+ '&#xA5;' => '¥',
73
+ '&brvbar;' => '¦',
74
+ '&#166;' => '¦',
75
+ '&#xA6;' => '¦',
76
+ '&sect;' => '§',
77
+ '&#167;' => '§',
78
+ '&#xA7;' => '§',
79
+ '&uml;' => '¨',
80
+ '&#168;' => '¨',
81
+ '&#xA8;' => '¨',
82
+ '&copy;' => '©',
83
+ '&#169;' => '©',
84
+ '&#xA9;' => '©',
85
+ '&ordf;' => 'ª',
86
+ '&#170;' => 'ª',
87
+ '&#xAA;' => 'ª',
88
+ '&laquo;' => '«',
89
+ '&#171;' => '«',
90
+ '&#xAB;' => '«',
91
+ '&not;' => '¬',
92
+ '&#172;' => '¬',
93
+ '&#xAC;' => '¬',
94
+ '&reg;' => '®',
95
+ '&#174;' => '®',
96
+ '&#xAE;' => '®',
97
+ '&macr;' => '¯',
98
+ '&#175;' => '¯',
99
+ '&#xAF;' => '¯',
100
+ '&deg;' => '°',
101
+ '&#176;' => '°',
102
+ '&#xB0;' => '°',
103
+ '&plusmn;' => '±',
104
+ '&#177;' => '±',
105
+ '&#xB1;' => '±',
106
+ '&sup2;' => '²',
107
+ '&#178;' => '²',
108
+ '&#xB2;' => '²',
109
+ '&sup3;' => '³',
110
+ '&#179;' => '³',
111
+ '&#xB3;' => '³',
112
+ '&acute;' => '´',
113
+ '&#180;' => '´',
114
+ '&#xB4;' => '´',
115
+ '&micro;' => 'µ',
116
+ '&#181;' => 'µ',
117
+ '&#xB5;' => 'µ',
118
+ '&para;' => '¶',
119
+ '&#182;' => '¶',
120
+ '&#xB6;' => '¶',
121
+ '&middot;' => '·',
122
+ '&#183;' => '·',
123
+ '&#xB7;' => '·',
124
+ '&cedil;' => '¸',
125
+ '&#184;' => '¸',
126
+ '&#xB8;' => '¸',
127
+ '&sup1;' => '¹',
128
+ '&#185;' => '¹',
129
+ '&#xB9;' => '¹',
130
+ '&ordm;' => 'º',
131
+ '&#186;' => 'º',
132
+ '&#xBA;' => 'º',
133
+ '&raquo;' => '»',
134
+ '&#187;' => '»',
135
+ '&#xBB;' => '»',
136
+ '&frac14;' => '¼',
137
+ '&#188;' => '¼',
138
+ '&#xBC;' => '¼',
139
+ '&frac12;' => '½',
140
+ '&#189;' => '½',
141
+ '&#xBD;' => '½',
142
+ '&frac34;' => '¾',
143
+ '&#190;' => '¾',
144
+ '&#xBE;' => '¾',
145
+ '&iquest;' => '¿',
146
+ '&#191;' => '¿',
147
+ '&#xBF;' => '¿',
148
+ '&Agrave;' => 'À',
149
+ '&#192;' => 'À',
150
+ '&#xC0;' => 'À',
151
+ '&Aacute;' => 'Á',
152
+ '&#193;' => 'Á',
153
+ '&#xC1;' => 'Á',
154
+ '&Acirc;' => 'Â',
155
+ '&#194;' => 'Â',
156
+ '&#xC2;' => 'Â',
157
+ '&Atilde;' => 'Ã',
158
+ '&#195;' => 'Ã',
159
+ '&#xC3;' => 'Ã',
160
+ '&Auml;' => 'Ä',
161
+ '&#196;' => 'Ä',
162
+ '&#xC4;' => 'Ä',
163
+ '&Aring;' => 'Å',
164
+ '&#197;' => 'Å',
165
+ '&#xC5;' => 'Å',
166
+ '&AElig;' => 'Æ',
167
+ '&#198;' => 'Æ',
168
+ '&#xC6;' => 'Æ',
169
+ '&Ccedil;' => 'Ç',
170
+ '&#199;' => 'Ç',
171
+ '&#xC7;' => 'Ç',
172
+ '&Egrave;' => 'È',
173
+ '&#200;' => 'È',
174
+ '&#xC8;' => 'È',
175
+ '&Eacute;' => 'É',
176
+ '&#201;' => 'É',
177
+ '&#xC9;' => 'É',
178
+ '&Ecirc;' => 'Ê',
179
+ '&#202;' => 'Ê',
180
+ '&#xCA;' => 'Ê',
181
+ '&Euml;' => 'Ë',
182
+ '&#203;' => 'Ë',
183
+ '&#xCB;' => 'Ë',
184
+ '&Igrave;' => 'Ì',
185
+ '&#204;' => 'Ì',
186
+ '&#xCC;' => 'Ì',
187
+ '&Iacute;' => 'Í',
188
+ '&#205;' => 'Í',
189
+ '&#xCD;' => 'Í',
190
+ '&Icirc;' => 'Î',
191
+ '&#206;' => 'Î',
192
+ '&#xCE;' => 'Î',
193
+ '&Iuml;' => 'Ï',
194
+ '&#207;' => 'Ï',
195
+ '&#xCF;' => 'Ï',
196
+ '&ETH;' => 'Ð',
197
+ '&#208;' => 'Ð',
198
+ '&#xD0;' => 'Ð',
199
+ '&Ntilde;' => 'Ñ',
200
+ '&#209;' => 'Ñ',
201
+ '&#xD1;' => 'Ñ',
202
+ '&Ograve;' => 'Ò',
203
+ '&#210;' => 'Ò',
204
+ '&#xD2;' => 'Ò',
205
+ '&Oacute;' => 'Ó',
206
+ '&#211;' => 'Ó',
207
+ '&#xD3;' => 'Ó',
208
+ '&Ocirc;' => 'Ô',
209
+ '&#212;' => 'Ô',
210
+ '&#xD4;' => 'Ô',
211
+ '&Otilde;' => 'Õ',
212
+ '&#213;' => 'Õ',
213
+ '&#xD5;' => 'Õ',
214
+ '&Ouml;' => 'Ö',
215
+ '&#214;' => 'Ö',
216
+ '&#xD6;' => 'Ö',
217
+ '&times;' => '×',
218
+ '&#215;' => '×',
219
+ '&#xD7;' => '×',
220
+ '&Oslash;' => 'Ø',
221
+ '&#216;' => 'Ø',
222
+ '&#xD8;' => 'Ø',
223
+ '&Ugrave;' => 'Ù',
224
+ '&#217;' => 'Ù',
225
+ '&#xD9;' => 'Ù',
226
+ '&Uacute;' => 'Ú',
227
+ '&#218;' => 'Ú',
228
+ '&#xDA;' => 'Ú',
229
+ '&Ucirc;' => 'Û',
230
+ '&#219;' => 'Û',
231
+ '&#xDB;' => 'Û',
232
+ '&Uuml;' => 'Ü',
233
+ '&#220;' => 'Ü',
234
+ '&#xDC;' => 'Ü',
235
+ '&Yacute;' => 'Ý',
236
+ '&#221;' => 'Ý',
237
+ '&#xDD;' => 'Ý',
238
+ '&THORN;' => 'Þ',
239
+ '&#222;' => 'Þ',
240
+ '&#xDE;' => 'Þ',
241
+ '&szlig;' => 'ß',
242
+ '&#223;' => 'ß',
243
+ '&#xDF;' => 'ß',
244
+ '&agrave;' => 'à',
245
+ '&#224;' => 'à',
246
+ '&#xE0;' => 'à',
247
+ '&aacute;' => 'á',
248
+ '&#225;' => 'á',
249
+ '&#xE1;' => 'á',
250
+ '&acirc;' => 'â',
251
+ '&#226;' => 'â',
252
+ '&#xE2;' => 'â',
253
+ '&atilde;' => 'ã',
254
+ '&#227;' => 'ã',
255
+ '&#xE3;' => 'ã',
256
+ '&auml;' => 'ä',
257
+ '&#228;' => 'ä',
258
+ '&#xE4;' => 'ä',
259
+ '&aring;' => 'å',
260
+ '&#229;' => 'å',
261
+ '&#xE5;' => 'å',
262
+ '&aelig;' => 'æ',
263
+ '&#230;' => 'æ',
264
+ '&#xE6;' => 'æ',
265
+ '&ccedil;' => 'ç',
266
+ '&#231;' => 'ç',
267
+ '&#xE7;' => 'ç',
268
+ '&egrave;' => 'è',
269
+ '&#232;' => 'è',
270
+ '&#xE8;' => 'è',
271
+ '&eacute;' => 'é',
272
+ '&#233;' => 'é',
273
+ '&#xE9;' => 'é',
274
+ '&ecirc;' => 'ê',
275
+ '&#234;' => 'ê',
276
+ '&#xEA;' => 'ê',
277
+ '&euml;' => 'ë',
278
+ '&#235;' => 'ë',
279
+ '&#xEB;' => 'ë',
280
+ '&igrave;' => 'ì',
281
+ '&#236;' => 'ì',
282
+ '&#xEC;' => 'ì',
283
+ '&iacute;' => 'í',
284
+ '&#237;' => 'í',
285
+ '&#xED;' => 'í',
286
+ '&icirc;' => 'î',
287
+ '&#238;' => 'î',
288
+ '&#xEE;' => 'î',
289
+ '&iuml;' => 'ï',
290
+ '&#239;' => 'ï',
291
+ '&#xEF;' => 'ï',
292
+ '&eth;' => 'ð',
293
+ '&#240;' => 'ð',
294
+ '&#xF0;' => 'ð',
295
+ '&ntilde;' => 'ñ',
296
+ '&#241;' => 'ñ',
297
+ '&#xF1;' => 'ñ',
298
+ '&ograve;' => 'ò',
299
+ '&#242;' => 'ò',
300
+ '&#xF2;' => 'ò',
301
+ '&oacute;' => 'ó',
302
+ '&#243;' => 'ó',
303
+ '&#xF3;' => 'ó',
304
+ '&ocirc;' => 'ô',
305
+ '&#244;' => 'ô',
306
+ '&#xF4;' => 'ô',
307
+ '&otilde;' => 'õ',
308
+ '&#245;' => 'õ',
309
+ '&#xF5;' => 'õ',
310
+ '&ouml;' => 'ö',
311
+ '&#246;' => 'ö',
312
+ '&#xF6;' => 'ö',
313
+ '&divide;' => '÷',
314
+ '&#247;' => '÷',
315
+ '&#xF7;' => '÷',
316
+ '&oslash;' => 'ø',
317
+ '&#248;' => 'ø',
318
+ '&#xF8;' => 'ø',
319
+ '&ugrave;' => 'ù',
320
+ '&#249;' => 'ù',
321
+ '&#xF9;' => 'ù',
322
+ '&uacute;' => 'ú',
323
+ '&#250;' => 'ú',
324
+ '&#xFA;' => 'ú',
325
+ '&ucirc;' => 'û',
326
+ '&#251;' => 'û',
327
+ '&#xFB;' => 'û',
328
+ '&uuml;' => 'ü',
329
+ '&#252;' => 'ü',
330
+ '&#xFC;' => 'ü',
331
+ '&yacute;' => 'ý',
332
+ '&#253;' => 'ý',
333
+ '&#xFD;' => 'ý',
334
+ '&thorn;' => 'þ',
335
+ '&#254;' => 'þ',
336
+ '&#xFE;' => 'þ',
337
+ '&yuml;' => 'ÿ',
338
+ '&#255;' => 'ÿ',
339
+ '&#xFF;' => 'ÿ',
340
+ '&quot;' => '"',
341
+ '&#34;' => '"',
342
+ '&#x22;' => '"',
343
+ '&amp;' => '&',
344
+ '&#38;' => '&',
345
+ '&#x26;' => '&',
346
+ '&lt;' => '<',
347
+ '&#60;' => '<',
348
+ '&#x3C;' => '<',
349
+ '&gt;' => '>',
350
+ '&#62;' => '>',
351
+ '&#x3E;' => '>',
352
+ '&OElig;' => 'Œ',
353
+ '&#338;' => 'Œ',
354
+ '&#x152;' => 'Œ',
355
+ '&oelig;' => 'œ',
356
+ '&#339;' => 'œ',
357
+ '&#x153;' => 'œ',
358
+ '&Scaron;' => 'Š',
359
+ '&#352;' => 'Š',
360
+ '&#x160;' => 'Š',
361
+ '&scaron;' => 'š',
362
+ '&#353;' => 'š',
363
+ '&#x161;' => 'š',
364
+ '&Yuml;' => 'Ÿ',
365
+ '&#376;' => 'Ÿ',
366
+ '&#x178;' => 'Ÿ',
367
+ '&circ;' => 'ˆ',
368
+ '&#710;' => 'ˆ',
369
+ '&#x2C6;' => 'ˆ',
370
+ '&tilde;' => '˜',
371
+ '&#732;' => '˜',
372
+ '&#x2DC;' => '˜',
373
+ '&ndash;' => '–',
374
+ '&#8211;' => '–',
375
+ '&#x2013;' => '–',
376
+ '&mdash;' => '—',
377
+ '&#8212;' => '—',
378
+ '&#x2014;' => '—',
379
+ '&lsquo;' => '‘',
380
+ '&#8216;' => '‘',
381
+ '&#x2018;' => '‘',
382
+ '&rsquo;' => '’',
383
+ '&#8217;' => '’',
384
+ '&#x2019;' => '’',
385
+ '&sbquo;' => '‚',
386
+ '&#8218;' => '‚',
387
+ '&#x201A;' => '‚',
388
+ '&ldquo;' => '“',
389
+ '&#8220;' => '“',
390
+ '&#x201C;' => '“',
391
+ '&rdquo;' => '”',
392
+ '&#8221;' => '”',
393
+ '&#x201D;' => '”',
394
+ '&bdquo;' => '„',
395
+ '&#8222;' => '„',
396
+ '&#x201E;' => '„',
397
+ '&dagger;' => '†',
398
+ '&#8224;' => '†',
399
+ '&#x2020;' => '†',
400
+ '&Dagger;' => '‡',
401
+ '&#8225;' => '‡',
402
+ '&#x2021;' => '‡',
403
+ '&permil;' => '‰',
404
+ '&#8240;' => '‰',
405
+ '&#x2030;' => '‰',
406
+ '&lsaquo;' => '‹',
407
+ '&#8249;' => '‹',
408
+ '&#x2039;' => '‹',
409
+ '&rsaquo;' => '›',
410
+ '&#8250;' => '›',
411
+ '&#x203A;' => '›',
412
+ '&euro;' => '€',
413
+ '&#8364;' => '€',
414
+ '&#x20AC;' => '€',
415
+ '&fnof;' => 'ƒ',
416
+ '&#402;' => 'ƒ',
417
+ '&#x192;' => 'ƒ',
418
+ '&Alpha;' => 'Α',
419
+ '&#913;' => 'Α',
420
+ '&#x391;' => 'Α',
421
+ '&Beta;' => 'Β',
422
+ '&#914;' => 'Β',
423
+ '&#x392;' => 'Β',
424
+ '&Gamma;' => 'Γ',
425
+ '&#915;' => 'Γ',
426
+ '&#x393;' => 'Γ',
427
+ '&Delta;' => 'Δ',
428
+ '&#916;' => 'Δ',
429
+ '&#x394;' => 'Δ',
430
+ '&Epsilon;' => 'Ε',
431
+ '&#917;' => 'Ε',
432
+ '&#x395;' => 'Ε',
433
+ '&Zeta;' => 'Ζ',
434
+ '&#918;' => 'Ζ',
435
+ '&#x396;' => 'Ζ',
436
+ '&Eta;' => 'Η',
437
+ '&#919;' => 'Η',
438
+ '&#x397;' => 'Η',
439
+ '&Theta;' => 'Θ',
440
+ '&#920;' => 'Θ',
441
+ '&#x398;' => 'Θ',
442
+ '&Iota;' => 'Ι',
443
+ '&#921;' => 'Ι',
444
+ '&#x399;' => 'Ι',
445
+ '&Kappa;' => 'Κ',
446
+ '&#922;' => 'Κ',
447
+ '&#x39A;' => 'Κ',
448
+ '&Lambda;' => 'Λ',
449
+ '&#923;' => 'Λ',
450
+ '&#x39B;' => 'Λ',
451
+ '&Mu;' => 'Μ',
452
+ '&#924;' => 'Μ',
453
+ '&#x39C;' => 'Μ',
454
+ '&Nu;' => 'Ν',
455
+ '&#925;' => 'Ν',
456
+ '&#x39D;' => 'Ν',
457
+ '&Xi;' => 'Ξ',
458
+ '&#926;' => 'Ξ',
459
+ '&#x39E;' => 'Ξ',
460
+ '&Omicron;' => 'Ο',
461
+ '&#927;' => 'Ο',
462
+ '&#x39F;' => 'Ο',
463
+ '&Pi;' => 'Π',
464
+ '&#928;' => 'Π',
465
+ '&#x3A0;' => 'Π',
466
+ '&Rho;' => 'Ρ',
467
+ '&#929;' => 'Ρ',
468
+ '&#x3A1;' => 'Ρ',
469
+ '&Sigma;' => 'Σ',
470
+ '&#931;' => 'Σ',
471
+ '&#x3A3;' => 'Σ',
472
+ '&Tau;' => 'Τ',
473
+ '&#932;' => 'Τ',
474
+ '&#x3A4;' => 'Τ',
475
+ '&Upsilon;' => 'Υ',
476
+ '&#933;' => 'Υ',
477
+ '&#x3A5;' => 'Υ',
478
+ '&Phi;' => 'Φ',
479
+ '&#934;' => 'Φ',
480
+ '&#x3A6;' => 'Φ',
481
+ '&Chi;' => 'Χ',
482
+ '&#935;' => 'Χ',
483
+ '&#x3A7;' => 'Χ',
484
+ '&Psi;' => 'Ψ',
485
+ '&#936;' => 'Ψ',
486
+ '&#x3A8;' => 'Ψ',
487
+ '&Omega;' => 'Ω',
488
+ '&#937;' => 'Ω',
489
+ '&#x3A9;' => 'Ω',
490
+ '&alpha;' => 'α',
491
+ '&#945;' => 'α',
492
+ '&#x3B1;' => 'α',
493
+ '&beta;' => 'β',
494
+ '&#946;' => 'β',
495
+ '&#x3B2;' => 'β',
496
+ '&gamma;' => 'γ',
497
+ '&#947;' => 'γ',
498
+ '&#x3B3;' => 'γ',
499
+ '&delta;' => 'δ',
500
+ '&#948;' => 'δ',
501
+ '&#x3B4;' => 'δ',
502
+ '&epsilon;' => 'ε',
503
+ '&#949;' => 'ε',
504
+ '&#x3B5;' => 'ε',
505
+ '&zeta;' => 'ζ',
506
+ '&#950;' => 'ζ',
507
+ '&#x3B6;' => 'ζ',
508
+ '&eta;' => 'η',
509
+ '&#951;' => 'η',
510
+ '&#x3B7;' => 'η',
511
+ '&theta;' => 'θ',
512
+ '&#952;' => 'θ',
513
+ '&#x3B8;' => 'θ',
514
+ '&iota;' => 'ι',
515
+ '&#953;' => 'ι',
516
+ '&#x3B9;' => 'ι',
517
+ '&kappa;' => 'κ',
518
+ '&#954;' => 'κ',
519
+ '&#x3BA;' => 'κ',
520
+ '&lambda;' => 'λ',
521
+ '&#955;' => 'λ',
522
+ '&#x3BB;' => 'λ',
523
+ '&mu;' => 'μ',
524
+ '&#956;' => 'μ',
525
+ '&#x3BC;' => 'μ',
526
+ '&nu;' => 'ν',
527
+ '&#957;' => 'ν',
528
+ '&#x3BD;' => 'ν',
529
+ '&xi;' => 'ξ',
530
+ '&#958;' => 'ξ',
531
+ '&#x3BE;' => 'ξ',
532
+ '&omicron;' => 'ο',
533
+ '&#959;' => 'ο',
534
+ '&#x3BF;' => 'ο',
535
+ '&pi;' => 'π',
536
+ '&#960;' => 'π',
537
+ '&#x3C0;' => 'π',
538
+ '&rho;' => 'ρ',
539
+ '&#961;' => 'ρ',
540
+ '&#x3C1;' => 'ρ',
541
+ '&sigmaf;' => 'ς',
542
+ '&#962;' => 'ς',
543
+ '&#x3C2;' => 'ς',
544
+ '&sigma;' => 'σ',
545
+ '&#963;' => 'σ',
546
+ '&#x3C3;' => 'σ',
547
+ '&tau;' => 'τ',
548
+ '&#964;' => 'τ',
549
+ '&#x3C4;' => 'τ',
550
+ '&upsilon;' => 'υ',
551
+ '&#965;' => 'υ',
552
+ '&#x3C5;' => 'υ',
553
+ '&phi;' => 'φ',
554
+ '&#966;' => 'φ',
555
+ '&#x3C6;' => 'φ',
556
+ '&chi;' => 'χ',
557
+ '&#967;' => 'χ',
558
+ '&#x3C7;' => 'χ',
559
+ '&psi;' => 'ψ',
560
+ '&#968;' => 'ψ',
561
+ '&#x3C8;' => 'ψ',
562
+ '&omega;' => 'ω',
563
+ '&#969;' => 'ω',
564
+ '&#x3C9;' => 'ω',
565
+ '&thetasym;' => 'ϑ',
566
+ '&#977;' => 'ϑ',
567
+ '&#x3D1;' => 'ϑ',
568
+ '&upsih;' => 'ϒ',
569
+ '&#978;' => 'ϒ',
570
+ '&#x3D2;' => 'ϒ',
571
+ '&piv;' => 'ϖ',
572
+ '&#982;' => 'ϖ',
573
+ '&#x3D6;' => 'ϖ',
574
+ '&bull;' => '•',
575
+ '&#8226;' => '•',
576
+ '&#x2022;' => '•',
577
+ '&hellip;' => '…',
578
+ '&#8230;' => '…',
579
+ '&#x2026;' => '…',
580
+ '&prime;' => '′',
581
+ '&#8242;' => '′',
582
+ '&#x2032;' => '′',
583
+ '&Prime;' => '″',
584
+ '&#8243;' => '″',
585
+ '&#x2033;' => '″',
586
+ '&oline;' => '‾',
587
+ '&#8254;' => '‾',
588
+ '&#x203E;' => '‾',
589
+ '&frasl;' => '⁄',
590
+ '&#8260;' => '⁄',
591
+ '&#x2044;' => '⁄',
592
+ '&weierp;' => '℘',
593
+ '&#8472;' => '℘',
594
+ '&#x2118;' => '℘',
595
+ '&image;' => 'ℑ',
596
+ '&#8465;' => 'ℑ',
597
+ '&#x2111;' => 'ℑ',
598
+ '&real;' => 'ℜ',
599
+ '&#8476;' => 'ℜ',
600
+ '&#x211C;' => 'ℜ',
601
+ '&trade;' => '™',
602
+ '&#8482;' => '™',
603
+ '&#x2122;' => '™',
604
+ '&alefsym;' => 'ℵ',
605
+ '&#8501;' => 'ℵ',
606
+ '&#x2135;' => 'ℵ',
607
+ '&larr;' => '←',
608
+ '&#8592;' => '←',
609
+ '&#x2190;' => '←',
610
+ '&uarr;' => '↑',
611
+ '&#8593;' => '↑',
612
+ '&#x2191;' => '↑',
613
+ '&rarr;' => '→',
614
+ '&#8594;' => '→',
615
+ '&#x2192;' => '→',
616
+ '&darr;' => '↓',
617
+ '&#8595;' => '↓',
618
+ '&#x2193;' => '↓',
619
+ '&harr;' => '↔',
620
+ '&#8596;' => '↔',
621
+ '&#x2194;' => '↔',
622
+ '&crarr;' => '↵',
623
+ '&#8629;' => '↵',
624
+ '&#x21B5;' => '↵',
625
+ '&lArr;' => '⇐',
626
+ '&#8656;' => '⇐',
627
+ '&#x21D0;' => '⇐',
628
+ '&uArr;' => '⇑',
629
+ '&#8657;' => '⇑',
630
+ '&#x21D1;' => '⇑',
631
+ '&rArr;' => '⇒',
632
+ '&#8658;' => '⇒',
633
+ '&#x21D2;' => '⇒',
634
+ '&dArr;' => '⇓',
635
+ '&#8659;' => '⇓',
636
+ '&#x21D3;' => '⇓',
637
+ '&hArr;' => '⇔',
638
+ '&#8660;' => '⇔',
639
+ '&#x21D4;' => '⇔',
640
+ '&forall;' => '∀',
641
+ '&#8704;' => '∀',
642
+ '&#x2200;' => '∀',
643
+ '&part;' => '∂',
644
+ '&#8706;' => '∂',
645
+ '&#x2202;' => '∂',
646
+ '&exist;' => '∃',
647
+ '&#8707;' => '∃',
648
+ '&#x2203;' => '∃',
649
+ '&empty;' => '∅',
650
+ '&#8709;' => '∅',
651
+ '&#x2205;' => '∅',
652
+ '&nabla;' => '∇',
653
+ '&#8711;' => '∇',
654
+ '&#x2207;' => '∇',
655
+ '&isin;' => '∈',
656
+ '&#8712;' => '∈',
657
+ '&#x2208;' => '∈',
658
+ '&notin;' => '∉',
659
+ '&#8713;' => '∉',
660
+ '&#x2209;' => '∉',
661
+ '&ni;' => '∋',
662
+ '&#8715;' => '∋',
663
+ '&#x220B;' => '∋',
664
+ '&prod;' => '∏',
665
+ '&#8719;' => '∏',
666
+ '&#x220F;' => '∏',
667
+ '&sum;' => '∑',
668
+ '&#8721;' => '∑',
669
+ '&#x2211;' => '∑',
670
+ '&minus;' => '−',
671
+ '&#8722;' => '−',
672
+ '&#x2212;' => '−',
673
+ '&lowast;' => '∗',
674
+ '&#8727;' => '∗',
675
+ '&#x2217;' => '∗',
676
+ '&radic;' => '√',
677
+ '&#8730;' => '√',
678
+ '&#x221A;' => '√',
679
+ '&prop;' => '∝',
680
+ '&#8733;' => '∝',
681
+ '&#x221D;' => '∝',
682
+ '&infin;' => '∞',
683
+ '&#8734;' => '∞',
684
+ '&#x221E;' => '∞',
685
+ '&ang;' => '∠',
686
+ '&#8736;' => '∠',
687
+ '&#x2220;' => '∠',
688
+ '&and;' => '∧',
689
+ '&#8743;' => '∧',
690
+ '&#x2227;' => '∧',
691
+ '&or;' => '∨',
692
+ '&#8744;' => '∨',
693
+ '&#x2228;' => '∨',
694
+ '&cap;' => '∩',
695
+ '&#8745;' => '∩',
696
+ '&#x2229;' => '∩',
697
+ '&cup;' => '∪',
698
+ '&#8746;' => '∪',
699
+ '&#x222A;' => '∪',
700
+ '&int;' => '∫',
701
+ '&#8747;' => '∫',
702
+ '&#x222B;' => '∫',
703
+ '&there4;' => '∴',
704
+ '&#8756;' => '∴',
705
+ '&#x2234;' => '∴',
706
+ '&sim;' => '∼',
707
+ '&#8764;' => '∼',
708
+ '&#x223C;' => '∼',
709
+ '&cong;' => '≅',
710
+ '&#8773;' => '≅',
711
+ '&#x2245;' => '≅',
712
+ '&asymp;' => '≈',
713
+ '&#8776;' => '≈',
714
+ '&#x2248;' => '≈',
715
+ '&ne;' => '≠',
716
+ '&#8800;' => '≠',
717
+ '&#x2260;' => '≠',
718
+ '&equiv;' => '≡',
719
+ '&#8801;' => '≡',
720
+ '&#x2261;' => '≡',
721
+ '&le;' => '≤',
722
+ '&#8804;' => '≤',
723
+ '&#x2264;' => '≤',
724
+ '&ge;' => '≥',
725
+ '&#8805;' => '≥',
726
+ '&#x2265;' => '≥',
727
+ '&sub;' => '⊂',
728
+ '&#8834;' => '⊂',
729
+ '&#x2282;' => '⊂',
730
+ '&sup;' => '⊃',
731
+ '&#8835;' => '⊃',
732
+ '&#x2283;' => '⊃',
733
+ '&nsub;' => '⊄',
734
+ '&#8836;' => '⊄',
735
+ '&#x2284;' => '⊄',
736
+ '&sube;' => '⊆',
737
+ '&#8838;' => '⊆',
738
+ '&#x2286;' => '⊆',
739
+ '&supe;' => '⊇',
740
+ '&#8839;' => '⊇',
741
+ '&#x2287;' => '⊇',
742
+ '&oplus;' => '⊕',
743
+ '&#8853;' => '⊕',
744
+ '&#x2295;' => '⊕',
745
+ '&otimes;' => '⊗',
746
+ '&#8855;' => '⊗',
747
+ '&#x2297;' => '⊗',
748
+ '&perp;' => '⊥',
749
+ '&#8869;' => '⊥',
750
+ '&#x22A5;' => '⊥',
751
+ '&sdot;' => '⋅',
752
+ '&#8901;' => '⋅',
753
+ '&#x22C5;' => '⋅',
754
+ '&lceil;' => '⌈',
755
+ '&#8968;' => '⌈',
756
+ '&#x2308;' => '⌈',
757
+ '&rceil;' => '⌉',
758
+ '&#8969;' => '⌉',
759
+ '&#x2309;' => '⌉',
760
+ '&lfloor;' => '⌊',
761
+ '&#8970;' => '⌊',
762
+ '&#x230A;' => '⌊',
763
+ '&rfloor;' => '⌋',
764
+ '&#8971;' => '⌋',
765
+ '&#x230B;' => '⌋',
766
+ '&loz;' => '◊',
767
+ '&#9674;' => '◊',
768
+ '&#x25CA;' => '◊',
769
+ '&spades;' => '♠',
770
+ '&#9824;' => '♠',
771
+ '&#x2660;' => '♠',
772
+ '&clubs;' => '♣',
773
+ '&#9827;' => '♣',
774
+ '&#x2663;' => '♣',
775
+ '&hearts;' => '♥',
776
+ '&#9829;' => '♥',
777
+ '&#x2665;' => '♥',
778
+ '&diams;' => '♦',
779
+ '&#9830;' => '♦',
780
+ '&#x2666;' => '♦'
781
+ }
782
+
783
+ MINIFIED_ENTITY = {
784
+ '&#173;' => '&shy;',
785
+ '&#xAD;' => '&shy;',
786
+ '&#8194;' => '&ensp;',
787
+ '&#x2002;' => '&ensp;',
788
+ '&#8195;' => '&emsp;',
789
+ '&#x2003;' => '&emsp;',
790
+ '&thinsp;' => '&#8201;',
791
+ '&#x2009;' => '&#8201;',
792
+ '&#8204;' => '&zwnj;',
793
+ '&#x200C;' => '&zwnj;',
794
+ '&#8205;' => '&zwj;',
795
+ '&#x200D;' => '&zwj;',
796
+ '&#8206;' => '&lrm;',
797
+ '&#x200E;' => '&lrm;',
798
+ '&#8207;' => '&rlm;',
799
+ '&#x200F;' => '&rlm;',
800
+ '&iexcl;' => '&#161;',
801
+ '&pound;' => '&#163;',
802
+ '&curren;' => '&#164;',
803
+ '&#165;' => '&yen;',
804
+ '&#xA5;' => '&yen;',
805
+ '&brvbar;' => '&#166;',
806
+ '&#168;' => '&uml;',
807
+ '&#xA8;' => '&uml;',
808
+ '&laquo;' => '&#171;',
809
+ '&#172;' => '&not;',
810
+ '&#xAC;' => '&not;',
811
+ '&#174;' => '&reg;',
812
+ '&#xAE;' => '&reg;',
813
+ '&#176;' => '&deg;',
814
+ '&#xB0;' => '&deg;',
815
+ '&plusmn;' => '&#177;',
816
+ '&acute;' => '&#180;',
817
+ '&micro;' => '&#181;',
818
+ '&middot;' => '&#183;',
819
+ '&cedil;' => '&#184;',
820
+ '&raquo;' => '&#187;',
821
+ '&frac14;' => '&#188;',
822
+ '&frac12;' => '&#189;',
823
+ '&frac34;' => '&#190;',
824
+ '&iquest;' => '&#191;',
825
+ '&Agrave;' => '&#192;',
826
+ '&Aacute;' => '&#193;',
827
+ '&Acirc;' => '&#194;',
828
+ '&Atilde;' => '&#195;',
829
+ '&Aring;' => '&#197;',
830
+ '&AElig;' => '&#198;',
831
+ '&Ccedil;' => '&#199;',
832
+ '&Egrave;' => '&#200;',
833
+ '&Eacute;' => '&#201;',
834
+ '&Ecirc;' => '&#202;',
835
+ '&Igrave;' => '&#204;',
836
+ '&Iacute;' => '&#205;',
837
+ '&Icirc;' => '&#206;',
838
+ '&#208;' => '&ETH;',
839
+ '&#xD0;' => '&ETH;',
840
+ '&Ntilde;' => '&#209;',
841
+ '&Ograve;' => '&#210;',
842
+ '&Oacute;' => '&#211;',
843
+ '&Ocirc;' => '&#212;',
844
+ '&Otilde;' => '&#213;',
845
+ '&times;' => '&#215;',
846
+ '&Oslash;' => '&#216;',
847
+ '&Ugrave;' => '&#217;',
848
+ '&Uacute;' => '&#218;',
849
+ '&Ucirc;' => '&#219;',
850
+ '&Yacute;' => '&#221;',
851
+ '&THORN;' => '&#222;',
852
+ '&agrave;' => '&#224;',
853
+ '&aacute;' => '&#225;',
854
+ '&acirc;' => '&#226;',
855
+ '&atilde;' => '&#227;',
856
+ '&aring;' => '&#229;',
857
+ '&aelig;' => '&#230;',
858
+ '&ccedil;' => '&#231;',
859
+ '&egrave;' => '&#232;',
860
+ '&eacute;' => '&#233;',
861
+ '&ecirc;' => '&#234;',
862
+ '&igrave;' => '&#236;',
863
+ '&iacute;' => '&#237;',
864
+ '&icirc;' => '&#238;',
865
+ '&#240;' => '&eth;',
866
+ '&#xF0;' => '&eth;',
867
+ '&ntilde;' => '&#241;',
868
+ '&ograve;' => '&#242;',
869
+ '&oacute;' => '&#243;',
870
+ '&ocirc;' => '&#244;',
871
+ '&otilde;' => '&#245;',
872
+ '&divide;' => '&#247;',
873
+ '&oslash;' => '&#248;',
874
+ '&ugrave;' => '&#249;',
875
+ '&uacute;' => '&#250;',
876
+ '&ucirc;' => '&#251;',
877
+ '&yacute;' => '&#253;',
878
+ '&thorn;' => '&#254;',
879
+ '&quot;' => '&#34;',
880
+ '&#x22;' => '&#34;',
881
+ '&#x26;' => '&#38;',
882
+ '&#60;' => '&lt;',
883
+ '&#x3C;' => '&lt;',
884
+ '&#62;' => '&gt;',
885
+ '&#x3E;' => '&gt;',
886
+ '&OElig;' => '&#338;',
887
+ '&#x152;' => '&#338;',
888
+ '&oelig;' => '&#339;',
889
+ '&#x153;' => '&#339;',
890
+ '&Scaron;' => '&#352;',
891
+ '&#x160;' => '&#352;',
892
+ '&scaron;' => '&#353;',
893
+ '&#x161;' => '&#353;',
894
+ '&#x178;' => '&Yuml;',
895
+ '&#x2C6;' => '&circ;',
896
+ '&tilde;' => '&#732;',
897
+ '&#x2DC;' => '&#732;',
898
+ '&#x2013;' => '&ndash;',
899
+ '&#x2014;' => '&mdash;',
900
+ '&#x2018;' => '&lsquo;',
901
+ '&#x2019;' => '&rsquo;',
902
+ '&#x201A;' => '&sbquo;',
903
+ '&#x201C;' => '&ldquo;',
904
+ '&#x201D;' => '&rdquo;',
905
+ '&#x201E;' => '&bdquo;',
906
+ '&dagger;' => '&#8224;',
907
+ '&#x2020;' => '&#8224;',
908
+ '&Dagger;' => '&#8225;',
909
+ '&#x2021;' => '&#8225;',
910
+ '&permil;' => '&#8240;',
911
+ '&#x2030;' => '&#8240;',
912
+ '&lsaquo;' => '&#8249;',
913
+ '&#x2039;' => '&#8249;',
914
+ '&rsaquo;' => '&#8250;',
915
+ '&#x203A;' => '&#8250;',
916
+ '&#8364;' => '&euro;',
917
+ '&#x20AC;' => '&euro;',
918
+ '&#x192;' => '&fnof;',
919
+ '&Alpha;' => '&#913;',
920
+ '&#x391;' => '&#913;',
921
+ '&#x392;' => '&Beta;',
922
+ '&Gamma;' => '&#915;',
923
+ '&#x393;' => '&#915;',
924
+ '&Delta;' => '&#916;',
925
+ '&#x394;' => '&#916;',
926
+ '&Epsilon;' => '&#917;',
927
+ '&#x395;' => '&#917;',
928
+ '&#x396;' => '&Zeta;',
929
+ '&#919;' => '&Eta;',
930
+ '&#x397;' => '&Eta;',
931
+ '&Theta;' => '&#920;',
932
+ '&#x398;' => '&#920;',
933
+ '&#x399;' => '&Iota;',
934
+ '&Kappa;' => '&#922;',
935
+ '&#x39A;' => '&#922;',
936
+ '&Lambda;' => '&#923;',
937
+ '&#x39B;' => '&#923;',
938
+ '&#924;' => '&Mu;',
939
+ '&#x39C;' => '&Mu;',
940
+ '&#925;' => '&Nu;',
941
+ '&#x39D;' => '&Nu;',
942
+ '&#926;' => '&Xi;',
943
+ '&#x39E;' => '&Xi;',
944
+ '&Omicron;' => '&#927;',
945
+ '&#x39F;' => '&#927;',
946
+ '&#928;' => '&Pi;',
947
+ '&#x3A0;' => '&Pi;',
948
+ '&#929;' => '&Rho;',
949
+ '&#x3A1;' => '&Rho;',
950
+ '&Sigma;' => '&#931;',
951
+ '&#x3A3;' => '&#931;',
952
+ '&#932;' => '&Tau;',
953
+ '&#x3A4;' => '&Tau;',
954
+ '&Upsilon;' => '&#933;',
955
+ '&#x3A5;' => '&#933;',
956
+ '&#934;' => '&Phi;',
957
+ '&#x3A6;' => '&Phi;',
958
+ '&#935;' => '&Chi;',
959
+ '&#x3A7;' => '&Chi;',
960
+ '&#936;' => '&Psi;',
961
+ '&#x3A8;' => '&Psi;',
962
+ '&Omega;' => '&#937;',
963
+ '&#x3A9;' => '&#937;',
964
+ '&alpha;' => '&#945;',
965
+ '&#x3B1;' => '&#945;',
966
+ '&#x3B2;' => '&beta;',
967
+ '&gamma;' => '&#947;',
968
+ '&#x3B3;' => '&#947;',
969
+ '&delta;' => '&#948;',
970
+ '&#x3B4;' => '&#948;',
971
+ '&epsilon;' => '&#949;',
972
+ '&#x3B5;' => '&#949;',
973
+ '&#x3B6;' => '&zeta;',
974
+ '&#951;' => '&eta;',
975
+ '&#x3B7;' => '&eta;',
976
+ '&theta;' => '&#952;',
977
+ '&#x3B8;' => '&#952;',
978
+ '&#x3B9;' => '&iota;',
979
+ '&kappa;' => '&#954;',
980
+ '&#x3BA;' => '&#954;',
981
+ '&lambda;' => '&#955;',
982
+ '&#x3BB;' => '&#955;',
983
+ '&#956;' => '&mu;',
984
+ '&#x3BC;' => '&mu;',
985
+ '&#957;' => '&nu;',
986
+ '&#x3BD;' => '&nu;',
987
+ '&#958;' => '&xi;',
988
+ '&#x3BE;' => '&xi;',
989
+ '&omicron;' => '&#959;',
990
+ '&#x3BF;' => '&#959;',
991
+ '&#960;' => '&pi;',
992
+ '&#x3C0;' => '&pi;',
993
+ '&#961;' => '&rho;',
994
+ '&#x3C1;' => '&rho;',
995
+ '&sigmaf;' => '&#962;',
996
+ '&#x3C2;' => '&#962;',
997
+ '&sigma;' => '&#963;',
998
+ '&#x3C3;' => '&#963;',
999
+ '&#964;' => '&tau;',
1000
+ '&#x3C4;' => '&tau;',
1001
+ '&upsilon;' => '&#965;',
1002
+ '&#x3C5;' => '&#965;',
1003
+ '&#966;' => '&phi;',
1004
+ '&#x3C6;' => '&phi;',
1005
+ '&#967;' => '&chi;',
1006
+ '&#x3C7;' => '&chi;',
1007
+ '&#968;' => '&psi;',
1008
+ '&#x3C8;' => '&psi;',
1009
+ '&omega;' => '&#969;',
1010
+ '&#x3C9;' => '&#969;',
1011
+ '&thetasym;' => '&#977;',
1012
+ '&#x3D1;' => '&#977;',
1013
+ '&upsih;' => '&#978;',
1014
+ '&#x3D2;' => '&#978;',
1015
+ '&#982;' => '&piv;',
1016
+ '&#x3D6;' => '&piv;',
1017
+ '&#8226;' => '&bull;',
1018
+ '&#x2022;' => '&bull;',
1019
+ '&hellip;' => '&#8230;',
1020
+ '&#x2026;' => '&#8230;',
1021
+ '&#x2032;' => '&prime;',
1022
+ '&#x2033;' => '&Prime;',
1023
+ '&#x203E;' => '&oline;',
1024
+ '&#x2044;' => '&frasl;',
1025
+ '&weierp;' => '&#8472;',
1026
+ '&#x2118;' => '&#8472;',
1027
+ '&#x2111;' => '&image;',
1028
+ '&#8476;' => '&real;',
1029
+ '&#x211C;' => '&real;',
1030
+ '&#x2122;' => '&trade;',
1031
+ '&alefsym;' => '&#8501;',
1032
+ '&#x2135;' => '&#8501;',
1033
+ '&#8592;' => '&larr;',
1034
+ '&#x2190;' => '&larr;',
1035
+ '&#8593;' => '&uarr;',
1036
+ '&#x2191;' => '&uarr;',
1037
+ '&#8594;' => '&rarr;',
1038
+ '&#x2192;' => '&rarr;',
1039
+ '&#8595;' => '&darr;',
1040
+ '&#x2193;' => '&darr;',
1041
+ '&#8596;' => '&harr;',
1042
+ '&#x2194;' => '&harr;',
1043
+ '&#x21B5;' => '&crarr;',
1044
+ '&#8656;' => '&lArr;',
1045
+ '&#x21D0;' => '&lArr;',
1046
+ '&#8657;' => '&uArr;',
1047
+ '&#x21D1;' => '&uArr;',
1048
+ '&#8658;' => '&rArr;',
1049
+ '&#x21D2;' => '&rArr;',
1050
+ '&#8659;' => '&dArr;',
1051
+ '&#x21D3;' => '&dArr;',
1052
+ '&#8660;' => '&hArr;',
1053
+ '&#x21D4;' => '&hArr;',
1054
+ '&forall;' => '&#8704;',
1055
+ '&#x2200;' => '&#8704;',
1056
+ '&#8706;' => '&part;',
1057
+ '&#x2202;' => '&part;',
1058
+ '&#x2203;' => '&exist;',
1059
+ '&#x2205;' => '&empty;',
1060
+ '&#x2207;' => '&nabla;',
1061
+ '&#8712;' => '&isin;',
1062
+ '&#x2208;' => '&isin;',
1063
+ '&#x2209;' => '&notin;',
1064
+ '&#8715;' => '&ni;',
1065
+ '&#x220B;' => '&ni;',
1066
+ '&#8719;' => '&prod;',
1067
+ '&#x220F;' => '&prod;',
1068
+ '&#8721;' => '&sum;',
1069
+ '&#x2211;' => '&sum;',
1070
+ '&#x2212;' => '&minus;',
1071
+ '&lowast;' => '&#8727;',
1072
+ '&#x2217;' => '&#8727;',
1073
+ '&#x221A;' => '&radic;',
1074
+ '&#8733;' => '&prop;',
1075
+ '&#x221D;' => '&prop;',
1076
+ '&#x221E;' => '&infin;',
1077
+ '&#8736;' => '&ang;',
1078
+ '&#x2220;' => '&ang;',
1079
+ '&#8743;' => '&and;',
1080
+ '&#x2227;' => '&and;',
1081
+ '&#8744;' => '&or;',
1082
+ '&#x2228;' => '&or;',
1083
+ '&#8745;' => '&cap;',
1084
+ '&#x2229;' => '&cap;',
1085
+ '&#8746;' => '&cup;',
1086
+ '&#x222A;' => '&cup;',
1087
+ '&#8747;' => '&int;',
1088
+ '&#x222B;' => '&int;',
1089
+ '&there4;' => '&#8756;',
1090
+ '&#x2234;' => '&#8756;',
1091
+ '&#8764;' => '&sim;',
1092
+ '&#x223C;' => '&sim;',
1093
+ '&#8773;' => '&cong;',
1094
+ '&#x2245;' => '&cong;',
1095
+ '&#x2248;' => '&asymp;',
1096
+ '&#8800;' => '&ne;',
1097
+ '&#x2260;' => '&ne;',
1098
+ '&#x2261;' => '&equiv;',
1099
+ '&#8804;' => '&le;',
1100
+ '&#x2264;' => '&le;',
1101
+ '&#8805;' => '&ge;',
1102
+ '&#x2265;' => '&ge;',
1103
+ '&#8834;' => '&sub;',
1104
+ '&#x2282;' => '&sub;',
1105
+ '&#8835;' => '&sup;',
1106
+ '&#x2283;' => '&sup;',
1107
+ '&#8836;' => '&nsub;',
1108
+ '&#x2284;' => '&nsub;',
1109
+ '&#8838;' => '&sube;',
1110
+ '&#x2286;' => '&sube;',
1111
+ '&#8839;' => '&supe;',
1112
+ '&#x2287;' => '&supe;',
1113
+ '&#x2295;' => '&oplus;',
1114
+ '&otimes;' => '&#8855;',
1115
+ '&#x2297;' => '&#8855;',
1116
+ '&#8869;' => '&perp;',
1117
+ '&#x22A5;' => '&perp;',
1118
+ '&#8901;' => '&sdot;',
1119
+ '&#x22C5;' => '&sdot;',
1120
+ '&#x2308;' => '&lceil;',
1121
+ '&#x2309;' => '&rceil;',
1122
+ '&lfloor;' => '&#8970;',
1123
+ '&#x230A;' => '&#8970;',
1124
+ '&rfloor;' => '&#8971;',
1125
+ '&#x230B;' => '&#8971;',
1126
+ '&#9674;' => '&loz;',
1127
+ '&#x25CA;' => '&loz;',
1128
+ '&spades;' => '&#9824;',
1129
+ '&#x2660;' => '&#9824;',
1130
+ '&#x2663;' => '&clubs;',
1131
+ '&hearts;' => '&#9829;',
1132
+ '&#x2665;' => '&#9829;',
1133
+ '&#x2666;' => '&diams;'
1134
+ }
1135
+
1136
+ end
1137
+
1138
+ end
1139
+
1140
+ end