Browse Source

:fire: <root>

visuddhinanda 3 năm trước cách đây
mục cha
commit
7aa8326368
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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);
   const parser = new DOMParser();
   const xmlDoc = parser.parseFromString(
-    "<root><root>" + text + "</root></root>",
+    "<root>" + text + "</root>",
     "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 {
     const ele = node as Element;