html-react-parser 3.0.11 → 3.0.12
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.
|
@@ -994,6 +994,7 @@
|
|
|
994
994
|
function formatDOM$1(nodes, parent, directive) {
|
|
995
995
|
parent = parent || null;
|
|
996
996
|
var result = [];
|
|
997
|
+
var tagName;
|
|
997
998
|
|
|
998
999
|
for (var index = 0, len = nodes.length; index < len; index++) {
|
|
999
1000
|
var node = nodes[index];
|
|
@@ -1002,14 +1003,12 @@
|
|
|
1002
1003
|
// set the node data given the type
|
|
1003
1004
|
switch (node.nodeType) {
|
|
1004
1005
|
case 1:
|
|
1006
|
+
tagName = formatTagName(node.nodeName);
|
|
1005
1007
|
// script, style, or tag
|
|
1006
|
-
current = new Element(
|
|
1007
|
-
formatTagName(node.nodeName),
|
|
1008
|
-
formatAttributes(node.attributes)
|
|
1009
|
-
);
|
|
1008
|
+
current = new Element(tagName, formatAttributes(node.attributes));
|
|
1010
1009
|
current.children = formatDOM$1(
|
|
1011
1010
|
// template children are on content
|
|
1012
|
-
|
|
1011
|
+
tagName === 'template' ? node.content.childNodes : node.childNodes,
|
|
1013
1012
|
current
|
|
1014
1013
|
);
|
|
1015
1014
|
break;
|