We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 779752b + 60e33a5 commit 426c0c1Copy full SHA for 426c0c1
lib/utils/xml-stream.js
@@ -7,24 +7,19 @@ const OPEN_ANGLE = '<';
7
const CLOSE_ANGLE = '>';
8
const OPEN_ANGLE_SLASH = '</';
9
const CLOSE_SLASH_ANGLE = '/>';
10
-const EQUALS_QUOTE = '="';
11
-const QUOTE = '"';
12
-const SPACE = ' ';
13
14
function pushAttribute(xml, name, value) {
15
- xml.push(SPACE);
16
- xml.push(name);
17
- xml.push(EQUALS_QUOTE);
18
- xml.push(utils.xmlEncode(value.toString()));
19
- xml.push(QUOTE);
+ xml.push(` ${name}="${utils.xmlEncode(value.toString())}"`);
20
}
21
function pushAttributes(xml, attributes) {
22
if (attributes) {
+ const tmp = [];
23
_.each(attributes, (value, name) => {
24
if (value !== undefined) {
25
- pushAttribute(xml, name, value);
+ pushAttribute(tmp, name, value);
26
27
});
+ xml.push(tmp.join(""));
28
29
30
0 commit comments