Skip to content

v2 formatter adds new line after self-closing tag #178

Closed
@KWeaver87

Description

@KWeaver87

Description

When formatting a minified XML file with the v2 formatter, a new line is added after each self-closing tag that has a following sibling. The new line is not added when formatting from an already formatted XML.

Example Minified XML:

<root><entry><field1>One</field1><field2/><field3>Three</field3><field4/><field5>Five</field5></entry></root>

Output:

<root>
  <entry>
    <field1>One</field1>
    <field2/>

    <field3>Three</field3>
    <field4/>

    <field5>Five</field5>
  </entry>
</root>

Expected output:

<root>
  <entry>
    <field1>One</field1>
    <field2/>
    <field3>Three</field3>
    <field4/>
    <field5>Five</field5>
  </entry>
</root>

Formatter Implementation

v2

XML Tools Version

2.1.1

VS Code Version

1.23.0

Operating System

Windows 10 Build 1709

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions