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)}`;
} }

View File

@ -1,5 +1,5 @@
<!DOCTYPE xml> <!DOCTYPE xml>
<core:FragmentDefinition xmlns="sap.m" <core:FragmentDefinition xmlns="sap.m"
xmlns:core="sap.ui.core"> xmlns:core="sap.ui.core">
<Text text="{parts: ['i18n>dialog.countdown.text','view>/Countdown'],formatter: 'jQuery.sap.formatMessage'}" /> <Text text="{parts: ['i18n>dialog.countdown.text','view>/Countdown'],formatter: 'jQuery.sap.formatMessage'}" />
</core:FragmentDefinition> </core:FragmentDefinition>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" /> <xsl:output method="xml" encoding="UTF-8" indent="yes" />