Parcourir la source

:fire: <root>

visuddhinanda il y a 3 ans
Parent
commit
7aa8326368
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      dashboard/src/components/template/utilities.ts

+ 3 - 3
dashboard/src/components/template/utilities.ts

@@ -24,11 +24,11 @@ export function XmlToReact(
   //console.log("html string:", text);
   //console.log("html string:", text);
   const parser = new DOMParser();
   const parser = new DOMParser();
   const xmlDoc = parser.parseFromString(
   const xmlDoc = parser.parseFromString(
-    "<root><root>" + text + "</root></root>",
+    "<root>" + text + "</root>",
     "text/xml"
     "text/xml"
   );
   );
-  const x = xmlDoc.documentElement.childNodes;
-  return convert(x[0], wordWidget, convertor);
+  const x = xmlDoc.documentElement;
+  return convert(x, wordWidget, convertor);
 
 
   function getAttr(node: ChildNode, key: number): Object {
   function getAttr(node: ChildNode, key: number): Object {
     const ele = node as Element;
     const ele = node as Element;