Skip to content

CDATA has unneeded leading whitespace when formatted #194

Closed
@tonyfinn

Description

@tonyfinn

Description

The following XML:

<?xml version="1.0" encoding="utf-8"?><madeup><some><element>This is ok</element><other><![CDATA[Here is my cdata]]></other></some></madeup>

is formatted as:

<?xml version="1.0" encoding="utf-8"?>
<madeup>
    <some>
        <element>This is ok</element>
        <other>            <![CDATA[Here is my cdata]]></other>
    </some>
</madeup>

The leading whitespace for the CDATA isn't required, I would expect it to be formatted as:

<?xml version="1.0" encoding="utf-8"?>
<madeup>
    <some>
        <element>This is ok</element>
        <other><![CDATA[Here is my cdata]]></other>
    </some>
</madeup>

Formatter Implementation

v2 (but the issue has been around a while, so likely exists in classic also)

XML Tools Version

2.2.0

VS Code Version

1.24.0

Operating System

MacOS High Sierra

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions