Add NewLine After Self-Closing Tags

#120
This commit is contained in:
Josh Johnson 2018-01-28 12:17:06 -05:00
parent 9941bafa74
commit e1d41f6025

View file

@ -112,12 +112,15 @@ export class V2XmlFormatter implements XmlFormatter {
// exiting StartTag or StartTag.StartTagName, entering Text
else if ((location === Location.StartTag || location === Location.StartTagName) && cc === ">") {
// if this was a self-closing tag, we need to decrement the indent level
// if this was a self-closing tag, we need to decrement the indent level and add a newLine
if (pc === "/") {
indentLevel--;
output += `>${options.newLine}`;
}
else {
output += ">";
}
lastNonTextLocation = location;
location = Location.Text;