Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nashwaan committed Oct 3, 2017
2 parents 6c99e85 + 440f39a commit ad921da
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/js2xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,19 @@ function hasContentCompact(element, options, anyContent) {

function writeElementCompact(element, name, options, depth, indent) {
var xml = '';
if (typeof element === 'undefined' || element === null) {
if (options.fullTagEmptyElement) {
return '<' + name + '></' + name + '>';
} else {
return '';
}
}
if (name) {
xml += '<' + name;
if (typeof element !== 'object') {
xml += '>' + writeText(element,options) + '</' + name + '>';
return xml;
}
if (element[options.attributesKey]) {
xml += writeAttributes(element[options.attributesKey], options, depth);
}
Expand Down

0 comments on commit ad921da

Please sign in to comment.