Преглед изворни кода

Use Strophe.serialize which results in better matching

JC Brand пре 4 месеци
родитељ
комит
05b0989298
1 измењених фајлова са 2 додато и 5 уклоњено
  1. 2 5
      src/utils/html.js

+ 2 - 5
src/utils/html.js

@@ -61,8 +61,6 @@ function getAutoCompleteProperty (name, options) {
     }[name];
 }
 
-const serializer = new XMLSerializer();
-
 /**
  * Given two XML or HTML elements, determine if they're equal
  * @param {Element} actual
@@ -96,12 +94,11 @@ function isEqualNode (actual, expected) {
         // This is not efficient, but currently this is only being used in tests.
         //
         const { xmlHtmlNode } = Strophe;
-        const actual_string = serializer.serializeToString(actual);
-        const expected_string = serializer.serializeToString(expected);
+        const actual_string = Strophe.serialize(actual);
+        const expected_string = Strophe.serialize(expected);
         isEqual =
             actual_string === expected_string || xmlHtmlNode(actual_string).isEqualNode(xmlHtmlNode(expected_string));
     }
-
     return isEqual;
 }