From 69de204dce1028891f1a036a46aaafad0ec2903a Mon Sep 17 00:00:00 2001 From: Jacob Wright Date: Mon, 3 Dec 2018 12:21:34 -0700 Subject: [PATCH] Fix error when an empty array is used content When an empty array is used for content, there are no children. Currently it creates 2 empty strings as the children of the element, which then prevents `/>` from being used. --- lib/xml.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/xml.js b/lib/xml.js index 01a5654..c02d845 100644 --- a/lib/xml.js +++ b/lib/xml.js @@ -178,6 +178,7 @@ function resolve(data, indent, indent_count) { } if (values.forEach) { + if (values.length === 0) break; isStringContent = false; content.push(''); values.forEach(function(value) {