DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
324 stars 86 forks source link

CDATA looses spaces after formatting #293

Closed martinr92 closed 4 years ago

martinr92 commented 4 years ago

Description

The formatting removes tabs within the CDATA if the CDATA is a XML.

Example (original) XML:

<xml>
    <element><![CDATA[asdf]]></element>
    <element><![CDATA[<secondXml>
    <formattedNode>val</formattedNode>
</secondXml>]]></element>
</xml>

The XML above becomes to:

<xml>
    <element><![CDATA[asdf]]></element>
    <element><![CDATA[<secondXml>
<formattedNode>val</formattedNode>
</secondXml>]]></element>
</xml>

As you can see the tab (or spaces) in front of the node "formattedNode" within the CDATA gets removed. Content within CDATA shouldn't get touched in anyway.

Formatter Implementation

default / not changed

XML Tools Version

XML Tools Version 2.5.0

VS Code Version

Visual Studio Code 1.40.2

Operating System

Windows 10