File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,19 @@ const OPEN_ANGLE = '<';
7
7
const CLOSE_ANGLE = '>' ;
8
8
const OPEN_ANGLE_SLASH = '</' ;
9
9
const CLOSE_SLASH_ANGLE = '/>' ;
10
- const EQUALS_QUOTE = '="' ;
11
- const QUOTE = '"' ;
12
- const SPACE = ' ' ;
13
10
14
11
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 ) ;
12
+ xml . push ( ` ${ name } ="${ utils . xmlEncode ( value . toString ( ) ) } "` ) ;
20
13
}
21
14
function pushAttributes ( xml , attributes ) {
22
15
if ( attributes ) {
16
+ const tmp = [ ] ;
23
17
_ . each ( attributes , ( value , name ) => {
24
18
if ( value !== undefined ) {
25
- pushAttribute ( xml , name , value ) ;
19
+ pushAttribute ( tmp , name , value ) ;
26
20
}
27
21
} ) ;
22
+ xml . push ( tmp . join ( "" ) ) ;
28
23
}
29
24
}
30
25
You can’t perform that action at this time.
0 commit comments