Skip to content

Commit 7b94228

Browse files
Merge pull request #620 from remarkablemark/build/html-dom-parser
build: upgrade domhandler to 5.0.3 and html-dom-parser to 3.0.0
2 parents 693cc3a + 55605da commit 7b94228

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ parse('<p>Hello, World!</p>'); // React.createElement('p', {}, 'Hello, World!')
4141
- [htmlparser2](#htmlparser2)
4242
- [trim](#trim)
4343
- [Migration](#migration)
44+
- [v3.0.0](#v300)
4445
- [v2.0.0](#v200)
4546
- [v1.0.0](#v100)
4647
- [FAQ](#faq)
@@ -371,6 +372,10 @@ parse('<p> </p>', { trim: true }); // React.createElement('p')
371372

372373
## Migration
373374

375+
### v3.0.0
376+
377+
[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.
378+
374379
### v2.0.0
375380

376381
Since [v2.0.0](https://github.com/remarkablemark/html-react-parser/releases/tag/v2.0.0), Internet Explorer (IE) is no longer supported.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"dom"
4545
],
4646
"dependencies": {
47-
"domhandler": "4.3.1",
48-
"html-dom-parser": "2.0.0",
47+
"domhandler": "5.0.3",
48+
"html-dom-parser": "3.0.0",
4949
"react-property": "2.0.0",
5050
"style-to-js": "1.1.1"
5151
},

test/types/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ parse('<p/><p/>', {
8686
// $ExpectType string | Element | Element[]
8787
parse('\t<p>text \r</p>\n', { trim: true });
8888

89-
// $ExpectType (Text | Comment | ProcessingInstruction | Element)[]
89+
// $ExpectType (Element | Text | Comment | ProcessingInstruction)[]
9090
const domNodes = htmlToDOM('<div>text</div>');
9191

9292
// $ExpectType string | Element | Element[]

test/types/lib/dom-to-react.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import domToReact from 'html-react-parser/lib/dom-to-react';
44
import * as React from 'react';
55
import htmlToDOM from 'html-dom-parser';
66

7-
// $ExpectType (Text | Comment | ProcessingInstruction | Element)[]
7+
// $ExpectType (Element | Text | Comment | ProcessingInstruction)[]
88
htmlToDOM('<div>text</div>');
99

1010
// $ExpectType string | Element | Element[]

0 commit comments

Comments
 (0)