1 | 2.3.2
|
2 | -----
|
3 |
|
4 | * Minimize data files, remove unnecessary files.
|
5 |
|
6 | 2.3.1
|
7 | -----
|
8 |
|
9 | * Improve performance of `encode()`, `decode()` and `decodeEntity()` by using function inlining.
|
10 | * Fix decoding HEX HTML entities in some cases.
|
11 |
|
12 | 2.3.0
|
13 | -----
|
14 |
|
15 | * Add flow types.
|
16 |
|
17 | 2.2.0
|
18 | -----
|
19 |
|
20 | * A fast `decodeEntity()` method to decode a single HTML entity.
|
21 |
|
22 | 2.1.1
|
23 | -----
|
24 |
|
25 | * Speed up both `encode()` and `decode()` methods.
|
26 |
|
27 | 2.1.0
|
28 | -----
|
29 |
|
30 | * Add `extensive` mode to `encode()` method. This mode encodes all non-printable characters, non-ASCII characters and all characters with named references.
|
31 |
|
32 | 2.0.6
|
33 | -----
|
34 |
|
35 | * Handle invalid numeric HTML entities: mimic browser behaviour.
|
36 |
|
37 | 2.0.5
|
38 | -----
|
39 |
|
40 | * Handling behaviour of ambiguous ampersands.
|
41 |
|
42 | 2.0.4
|
43 | -----
|
44 |
|
45 | * Fix webpack build warning.
|
46 |
|
47 | 2.0.3
|
48 | -----
|
49 |
|
50 | * Handle invalid numeric HTML entities.
|
51 |
|
52 | 2.0.2
|
53 | -----
|
54 |
|
55 | * Handle `null` and `undefined` text values.
|
56 |
|
57 | 2.0.1
|
58 | -----
|
59 |
|
60 | * Fix decoding numeric HTML entities.
|
61 |
|
62 | 2.0.0
|
63 | -----
|
64 |
|
65 | * Performance was greatly improved.
|
66 | * New API: simpler and more flexible.
|
67 |
|
68 | `htmlEntitiesInstance.encode(text)` -> `encode(text)`
|
69 |
|
70 | Before:
|
71 |
|
72 | ```js
|
73 | import {AllHtmlEntities} from 'html-entities';
|
74 |
|
75 | const entities = new AllHtmlEntities();
|
76 | console.log(
|
77 | entities.encode('<Hello & World>')
|
78 | );
|
79 | ```
|
80 |
|
81 | After:
|
82 |
|
83 | ```js
|
84 | import {encode} from 'html-entities';
|
85 |
|
86 | console.log(
|
87 | encode('<Hello & World>')
|
88 | );
|
89 | ```
|
90 |
|
91 | ---
|
92 |
|
93 | `instance.encodeNonASCII(text)` -> `encode(text, {mode: 'nonAscii'})`
|
94 |
|
95 | Before:
|
96 |
|
97 | ```js
|
98 | import {AllHtmlEntities} from 'html-entities';
|
99 |
|
100 | const entities = new AllHtmlEntities();
|
101 | console.log(
|
102 | entities.encodeNonASCII('& © ∆')
|
103 | );
|
104 | ```
|
105 |
|
106 | After:
|
107 |
|
108 | ```js
|
109 | import {encode} from 'html-entities';
|
110 |
|
111 | console.log(
|
112 | encode('& © ∆', {mode: 'nonAscii'})
|
113 | );
|
114 | ```
|
115 |
|
116 | ---
|
117 |
|
118 | `instance.encodeNonASCII(text)` -> `encode(text, {mode: 'nonAsciiPrintable'})`
|
119 |
|
120 | Before:
|
121 |
|
122 | ```js
|
123 | import {AllHtmlEntities} from 'html-entities';
|
124 |
|
125 | const entities = new AllHtmlEntities();
|
126 | console.log(
|
127 | entities.encodeNonASCII('& © ∆ \x01')
|
128 | );
|
129 | ```
|
130 |
|
131 | After:
|
132 |
|
133 | ```js
|
134 | import {encode} from 'html-entities';
|
135 |
|
136 | console.log(
|
137 | encode('& © ∆ \x01', {mode: 'nonAsciiPrintable'})
|
138 | );
|
139 | ```
|
140 |
|
141 | ---
|
142 |
|
143 | `instance.decode(text)` -> `decode(text)`
|
144 |
|
145 | Before:
|
146 |
|
147 | ```js
|
148 | import {AllHtmlEntities} from 'html-entities';
|
149 |
|
150 | const entities = new AllHtmlEntities();
|
151 | console.log(
|
152 | entities.decode('<>&')
|
153 | );
|
154 | ```
|
155 |
|
156 | After:
|
157 |
|
158 | ```js
|
159 | import {decode} from 'html-entities';
|
160 |
|
161 | console.log(
|
162 | decode('<>&')
|
163 | );
|
164 | ```
|
165 |
|
166 | ---
|
167 |
|
168 | Different XML/HTML versions are now implemented via options instead of different classes.
|
169 |
|
170 | Before:
|
171 |
|
172 | ```js
|
173 | import {XmlEntities, Html4Entities, Html5Entities, AllHtmlEntities} from 'html-entities';
|
174 |
|
175 | const xmlEntities = new XmlEntities();
|
176 | const html4Entities = new Html4Entities();
|
177 | const html5Entities = new Html5Entities();
|
178 | const allHtmlEntities = new AllHtmlEntities();
|
179 |
|
180 | console.log(xmlEntities.encode('<>&'));
|
181 | console.log(html4Entities.encode('<>&©'));
|
182 | console.log(html5Entities.encode('<>&©℞'));
|
183 | console.log(allHtmlEntities.encode('<>&©℞'));
|
184 |
|
185 | console.log(xmlEntities.decode('<>&'));
|
186 | console.log(html4Entities.decode('<>&©'));
|
187 | console.log(html5Entities.decode('<>&©℞'));
|
188 | console.log(allHtmlEntities.decode('<>&©℞'));
|
189 | ```
|
190 |
|
191 | After:
|
192 |
|
193 | ```js
|
194 | import {encode, decode} from 'html-entities';
|
195 |
|
196 | console.log(encode('<>&', {level: 'xml'}));
|
197 | console.log(encode('<>&©', {level: 'html4', mode: 'nonAscii'}));
|
198 | console.log(encode('<>&©℞', {level: 'html5', mode: 'nonAscii'}));
|
199 | console.log(encode('<>&©℞', {level: 'all', mode: 'nonAscii'}));
|
200 |
|
201 | console.log(decode('<>&', {level: 'xml'}));
|
202 | console.log(decode('<>&©', {level: 'html4'}));
|
203 | console.log(decode('<>&©℞', {level: 'html5'}));
|
204 | console.log(decode('<>&©℞', {level: 'all'}));
|
205 | ```
|
206 |
|
\ | No newline at end of file |