redhat-developer / vscode-xml

Editing XML in Visual Studio Code made easy
Eclipse Public License 2.0
254 stars 79 forks source link

formatting partially truncates trailing blanks #1017

Open CodingForFunToo opened 2 months ago

CodingForFunToo commented 2 months ago

When formatting elements with names that have trailing blanks, they a trimmed to only one trailing blank. An xml document <Node><Name>a name with trailing blanks </Name></Node> becomes

<Node>
    <Name>a name with trailing blanks </Name>
</Node>

after formatting (note that only one blank remains).

fbricon commented 2 months ago

Do you have

"files.trimTrailingWhitespace":true

in your settings.json?

fbricon commented 2 months ago

My bad this only applies to trailing whitespace at the end of the file