html-react-parser 4.2.1 → 4.2.2
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 +5 -5
- package/dist/html-react-parser.js +35 -32
- 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/lib/utilities.js +15 -10
- package/package.json +15 -15
package/lib/utilities.js
CHANGED
|
@@ -36,16 +36,6 @@ function invertObject(obj, override) {
|
|
|
36
36
|
return result;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
/**
|
|
40
|
-
* Check if a given tag is a custom component.
|
|
41
|
-
*
|
|
42
|
-
* @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
|
|
43
|
-
*
|
|
44
|
-
* @param {string} tagName - The name of the html tag.
|
|
45
|
-
* @param {object} props - The props being passed to the element.
|
|
46
|
-
* @returns - Whether tag is custom component.
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
39
|
var RESERVED_SVG_MATHML_ELEMENTS = new Set([
|
|
50
40
|
'annotation-xml',
|
|
51
41
|
'color-profile',
|
|
@@ -57,6 +47,15 @@ var RESERVED_SVG_MATHML_ELEMENTS = new Set([
|
|
|
57
47
|
'missing-glyph'
|
|
58
48
|
]);
|
|
59
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given tag is a custom component.
|
|
52
|
+
*
|
|
53
|
+
* @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
|
|
54
|
+
*
|
|
55
|
+
* @param {string} tagName - The name of the html tag.
|
|
56
|
+
* @param {object} props - The props being passed to the element.
|
|
57
|
+
* @returns {boolean} - Whether tag is custom component.
|
|
58
|
+
*/
|
|
60
59
|
function isCustomComponent(tagName, props) {
|
|
61
60
|
if (tagName.indexOf('-') === -1) {
|
|
62
61
|
return props && typeof props.is === 'string';
|
|
@@ -121,6 +120,12 @@ function canTextBeChildOfNode(node) {
|
|
|
121
120
|
return !ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node.name);
|
|
122
121
|
}
|
|
123
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Returns the first argument as is.
|
|
125
|
+
*
|
|
126
|
+
* @param {any} arg - The argument to be returned.
|
|
127
|
+
* @returns {any} The input argument `arg`.
|
|
128
|
+
*/
|
|
124
129
|
function returnFirstArg(arg) {
|
|
125
130
|
return arg;
|
|
126
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-react-parser",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "HTML to React parser.",
|
|
5
5
|
"author": "Mark <mark@remarkablemark.org>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -52,34 +52,34 @@
|
|
|
52
52
|
"domhandler": "5.0.3",
|
|
53
53
|
"html-dom-parser": "4.0.0",
|
|
54
54
|
"react-property": "2.0.0",
|
|
55
|
-
"style-to-js": "1.1.
|
|
55
|
+
"style-to-js": "1.1.4"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@commitlint/cli": "17.
|
|
59
|
-
"@commitlint/config-conventional": "17.
|
|
60
|
-
"@rollup/plugin-commonjs": "25.0.
|
|
61
|
-
"@rollup/plugin-node-resolve": "15.1
|
|
58
|
+
"@commitlint/cli": "17.7.1",
|
|
59
|
+
"@commitlint/config-conventional": "17.7.0",
|
|
60
|
+
"@rollup/plugin-commonjs": "25.0.4",
|
|
61
|
+
"@rollup/plugin-node-resolve": "15.2.1",
|
|
62
62
|
"@size-limit/preset-big-lib": "8.2.6",
|
|
63
|
-
"@types/react": "18.2.
|
|
64
|
-
"@typescript-eslint/parser": "6.
|
|
63
|
+
"@types/react": "18.2.21",
|
|
64
|
+
"@typescript-eslint/parser": "6.5.0",
|
|
65
65
|
"benchmark": "2.1.4",
|
|
66
66
|
"dtslint": "4.2.1",
|
|
67
|
-
"eslint": "8.
|
|
67
|
+
"eslint": "8.48.0",
|
|
68
68
|
"eslint-plugin-prettier": "5.0.0",
|
|
69
69
|
"husky": "8.0.3",
|
|
70
|
-
"jest": "29.6.
|
|
71
|
-
"jest-environment-jsdom": "29.6.
|
|
72
|
-
"lint-staged": "
|
|
70
|
+
"jest": "29.6.4",
|
|
71
|
+
"jest-environment-jsdom": "29.6.4",
|
|
72
|
+
"lint-staged": "14.0.1",
|
|
73
73
|
"pinst": "3.0.0",
|
|
74
|
-
"preact": "10.
|
|
75
|
-
"prettier": "3.0.
|
|
74
|
+
"preact": "10.17.1",
|
|
75
|
+
"prettier": "3.0.3",
|
|
76
76
|
"react": "18.2.0",
|
|
77
77
|
"react-dom": "18.2.0",
|
|
78
78
|
"rimraf": "5.0.1",
|
|
79
79
|
"rollup": "2.79.1",
|
|
80
80
|
"rollup-plugin-terser": "7.0.2",
|
|
81
81
|
"size-limit": "8.2.6",
|
|
82
|
-
"typescript": "5.
|
|
82
|
+
"typescript": "5.2.2"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "0.14 || 15 || 16 || 17 || 18"
|