Add Attribute Splitting

#116
This commit is contained in:
Josh Johnson 2018-01-28 12:09:57 -05:00
parent 8f0bf58462
commit 9941bafa74
5 changed files with 14 additions and 1 deletions

View file

@ -87,6 +87,10 @@ export class V2XmlFormatter implements XmlFormatter {
// entering StartTag.Attribute
else if (location === Location.StartTag && [" ", "/", ">"].indexOf(cc) === -1) {
if (lastNonTextLocation === Location.AttributeValue && ((options.splitXmlnsOnFormat && xml.substr(i, 5).toLowerCase() === "xmlns") || options.splitAttributesOnFormat)) {
output += `${options.newLine}${this._getIndent(options, indentLevel)}`;
}
output += cc;
lastNonTextLocation = location;
location = Location.Attribute;