html-react-parser 3.0.3 → 3.0.5
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.
- package/README.md +17 -0
- package/dist/html-react-parser.js +2390 -2398
- package/dist/html-react-parser.js.map +1 -1
- package/dist/html-react-parser.min.js +1 -1
- package/dist/html-react-parser.min.js.map +1 -1
- package/index.d.ts +5 -4
- package/index.js +10 -3
- package/index.mjs +5 -0
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://nodei.co/npm/html-react-parser/)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/html-react-parser)
|
|
6
|
+
[](https://bundlephobia.com/package/html-react-parser)
|
|
6
7
|
[](https://github.com/remarkablemark/html-react-parser/actions?query=workflow%3Abuild)
|
|
7
8
|
[](https://codecov.io/gh/remarkablemark/html-react-parser)
|
|
8
9
|
[](https://www.npmjs.com/package/html-react-parser)
|
|
@@ -56,6 +57,7 @@ parse('<p>Hello, World!</p>'); // React.createElement('p', {}, 'Hello, World!')
|
|
|
56
57
|
- [TS Error: Property 'attribs' does not exist on type 'DOMNode'](#ts-error-property-attribs-does-not-exist-on-type-domnode)
|
|
57
58
|
- [Can I enable `trim` for certain elements?](#can-i-enable-trim-for-certain-elements)
|
|
58
59
|
- [Webpack build warnings](#webpack-build-warnings)
|
|
60
|
+
- [TypeScript error](#typescript-error)
|
|
59
61
|
- [Performance](#performance)
|
|
60
62
|
- [Contributors](#contributors)
|
|
61
63
|
- [Code Contributors](#code-contributors)
|
|
@@ -377,6 +379,8 @@ parse('<p> </p>', { trim: true }); // React.createElement('p')
|
|
|
377
379
|
|
|
378
380
|
[domhandler](https://github.com/fb55/domhandler) has been upgraded to v5 so some [parser options](https://github.com/fb55/htmlparser2/wiki/Parser-options) like `normalizeWhitespace` have been removed.
|
|
379
381
|
|
|
382
|
+
Also, it's recommended to upgrade to the latest version of [typescript](https://www.npmjs.com/package/typescript).
|
|
383
|
+
|
|
380
384
|
### v2.0.0
|
|
381
385
|
|
|
382
386
|
Since [v2.0.0](https://github.com/remarkablemark/html-react-parser/releases/tag/v2.0.0), Internet Explorer (IE) is no longer supported.
|
|
@@ -488,6 +492,19 @@ module.exports = {
|
|
|
488
492
|
|
|
489
493
|
See [#238](https://github.com/remarkablemark/html-react-parser/issues/238) and [#213](https://github.com/remarkablemark/html-react-parser/issues/213).
|
|
490
494
|
|
|
495
|
+
### TypeScript error
|
|
496
|
+
|
|
497
|
+
If you see the TypeScript error:
|
|
498
|
+
|
|
499
|
+
```
|
|
500
|
+
node_modules/htmlparser2/lib/index.d.ts:2:23 - error TS1005: ',' expected.
|
|
501
|
+
|
|
502
|
+
2 export { Parser, type ParserOptions };
|
|
503
|
+
~~~~~~~~~~~~~
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
Then upgrade to the latest version of [typescript](https://www.npmjs.com/package/typescript). See [#748](https://github.com/remarkablemark/html-react-parser/issues/748).
|
|
507
|
+
|
|
491
508
|
## Performance
|
|
492
509
|
|
|
493
510
|
Run benchmark:
|