Fix Unnecessary Newline

fixes #147
This commit is contained in:
Josh Johnson 2018-05-02 20:30:42 -04:00
parent 64d3d3ad1a
commit 08ef6c4365
1 changed files with 6 additions and 1 deletions

View File

@ -138,7 +138,12 @@ export class V2XmlFormatter implements XmlFormatter {
// if this was a self-closing tag, we need to decrement the indent level and add a newLine
if (pc === "/") {
indentLevel--;
output += `>${options.newLine}`;
output += ">";
// only add a newline here if one doesn't already exist (issue #147)
if (nc !== "\r" && nc !== "\n") {
output += options.newLine;
}
}
else {