You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xmlMode:false, // Will overwrite what is used for the domhandler, otherwise inherited.
195
+
decodeEntities:true,
196
+
lowerCaseTags:true, // !xmlMode by default
197
+
lowerCaseAttributeNames:true, // !xmlMode by default
198
+
recognizeCDATA:false, // xmlMode by default
199
+
recognizeSelfClosing:false, // xmlMode by default
200
+
Tokenizer: Tokenizer,
200
201
};
201
202
```
202
203
203
204
If you are parsing HTML with SVG code you can set `lowerCaseTags` to `true` without having to enable `xmlMode`. Keep in mind this will return all tag names in camel-case and not the HTML standard of lowercase.
204
205
205
206
> **Note**: If you are parsing code client-side (in-browser), you can not control the parsing options. Client-side parsing automatically handles returning some HTML tags in camel-case, such as specific SVG elements, but returns all other tags lowercased according to the HTML standard.
206
207
207
-
## Testing
208
-
209
-
Run server and client tests:
210
-
211
-
```sh
212
-
npm test
213
-
```
214
-
215
-
Generate HTML coverage report for server tests:
216
-
217
-
```sh
218
-
npx nyc report --reporter=html
219
-
```
220
-
221
-
Lint files:
208
+
## Migration
222
209
223
-
```sh
224
-
npm run lint
225
-
npm run lint:fix
226
-
```
210
+
### v5
227
211
228
-
Test TypeScript declaration file for style and correctness:
212
+
Migrated to TypeScript. CommonJS imports require the `.default` key:
229
213
230
-
```sh
231
-
npm run lint:dts
214
+
```js
215
+
constparse=require('html-dom-parser').default;
232
216
```
233
217
234
-
## Migration
235
-
236
218
### v4
237
219
238
220
Upgraded [htmlparser2](https://github.com/fb55/htmlparser2) to v9.
0 commit comments