html-react-parser 6.1.7 → 6.1.8
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/dist/html-react-parser.js +13 -5
- 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/dom-to-react.d.ts.map +1 -1
- package/lib/dom-to-react.js +13 -5
- package/lib/dom-to-react.js.map +1 -1
- package/package.json +20 -21
- package/src/dom-to-react.ts +18 -8
|
@@ -3178,11 +3178,19 @@
|
|
|
3178
3178
|
}
|
|
3179
3179
|
function normalizeDOMNodes(nodes) {
|
|
3180
3180
|
for (const node of nodes) {
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3181
|
+
switch (node.type) {
|
|
3182
|
+
case 'tag':
|
|
3183
|
+
case 'script':
|
|
3184
|
+
case 'style':
|
|
3185
|
+
Object.setPrototypeOf(node, domhandler_1.Element.prototype);
|
|
3186
|
+
normalizeDOMNodes(node.children);
|
|
3187
|
+
break;
|
|
3188
|
+
case 'text':
|
|
3189
|
+
Object.setPrototypeOf(node, domhandler_1.Text.prototype);
|
|
3190
|
+
break;
|
|
3191
|
+
case 'comment':
|
|
3192
|
+
Object.setPrototypeOf(node, domhandler_1.Comment.prototype);
|
|
3193
|
+
break;
|
|
3186
3194
|
}
|
|
3187
3195
|
}
|
|
3188
3196
|
}
|