Trim Trailing Whitespace from Split Attributes

fixes #288
This commit is contained in:
Josh Johnson 2020-07-08 23:08:56 -04:00
parent 0cc71c7cc9
commit d4bf60d282
3 changed files with 6 additions and 2 deletions

View File

@ -163,6 +163,10 @@ export class V2XmlFormatter implements XmlFormatter {
&& ((options.splitXmlnsOnFormat && ((options.splitXmlnsOnFormat
&& xml.substr(i, 5).toLowerCase() === "xmlns") && xml.substr(i, 5).toLowerCase() === "xmlns")
|| options.splitAttributesOnFormat)) { || options.splitAttributesOnFormat)) {
// trim the end of output here to ensure there is no trailing whitespace (issue #288)
output = this._removeTrailingNonBreakingWhitespace(output);
output += `${options.newLine}${this._getIndent(options, indentLevel)}`; output += `${options.newLine}${this._getIndent(options, indentLevel)}`;
} }