Skip to content

Commit f11fa35

Browse files
fix(deps): bump html-dom-parser from 5.0.10 to 5.0.11 (#1623)
Fixes #864 Closes #1617
1 parent 86d571d commit f11fa35

File tree

4 files changed

+83
-10
lines changed

4 files changed

+83
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`HTMLReactParser parses HTML with newlines 1`] = `
4+
[
5+
"
6+
",
7+
<br />,
8+
]
9+
`;
10+
11+
exports[`HTMLReactParser parses HTML with newlines 2`] = `
12+
[
13+
<br />,
14+
"
15+
",
16+
]
17+
`;
18+
19+
exports[`HTMLReactParser parses HTML with newlines 3`] = `
20+
[
21+
"
22+
",
23+
<br />,
24+
"
25+
",
26+
]
27+
`;
28+
29+
exports[`HTMLReactParser parses HTML with newlines 4`] = `
30+
<p>
31+
foo
32+
bar
33+
</p>
34+
`;
35+
36+
exports[`HTMLReactParser parses HTML with newlines 5`] = `
37+
[
38+
<p>
39+
foo
40+
</p>,
41+
"
42+
bar",
43+
]
44+
`;
45+
46+
exports[`HTMLReactParser parses HTML with newlines 6`] = `
47+
[
48+
"foo",
49+
<p>
50+
51+
52+
bar
53+
</p>,
54+
"
55+
",
56+
]
57+
`;

__tests__/index.test.tsx

+21-4
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,30 @@ describe('HTMLReactParser', () => {
3939
},
4040
);
4141

42-
it('parses "" to []', () => {
42+
it('parses empty string to empty array', () => {
4343
expect(parse('')).toEqual([]);
4444
});
4545

46-
it("returns string if it's not HTML", () => {
47-
const string = 'text';
48-
expect(parse(string)).toBe(string);
46+
it.each(['a', 'text'])('parses string', (text) => {
47+
expect(parse(text)).toBe(text);
48+
});
49+
50+
it.each(['\n', '\r', '\n\r', 'foo\nbar', 'foo\rbar', 'foo\n\rbar\r'])(
51+
'parses string with newlines %p',
52+
(text) => {
53+
expect(parse(text)).toBe(text);
54+
},
55+
);
56+
57+
it.each([
58+
'\n<br>',
59+
'<br>\r',
60+
'\n<br>\r',
61+
'<p>foo\nbar\r</p>',
62+
'<p>foo</p>\rbar',
63+
'foo<p>\n\rbar</p>\r',
64+
])('parses HTML with newlines', (html) => {
65+
expect(parse(html)).toMatchSnapshot();
4966
});
5067

5168
it('parses single HTML element', () => {

package-lock.json

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"dependencies": {
5151
"domhandler": "5.0.3",
52-
"html-dom-parser": "5.0.10",
52+
"html-dom-parser": "5.0.11",
5353
"react-property": "2.0.2",
5454
"style-to-js": "1.1.16"
5555
},

0 commit comments

Comments
 (0)