Skip to content

Attribute values containing special chars shouldn't be touched.ย #189

Closed
@mschleeweiss

Description

@mschleeweiss

Description

When formatting XML where an attribute has a value that contains special chars (like single quotes) they also become formatted:

Input:

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

Format once:

<!DOCTYPE xml>
<core:FragmentDefinition xmlns="sap.m" 
    xmlns:core="sap.ui.core">

    <Text text="{parts: ['
        i18n>dialog.countdown.text','
        view>/Countdown'],formatter: '
        jQuery.sap.formatMessage'}" />

</core:FragmentDefinition>

Format twice:

<!DOCTYPE xml>
<core:FragmentDefinition xmlns="sap.m" 
    xmlns:core="sap.ui.core">

    <Text text="{parts: ['
    
        i18n>dialog.countdown.text','
    
        view>/Countdown'],formatter: '
    
        jQuery.sap.formatMessage'}" />

</core:FragmentDefinition>

The more you format it, the more newlines will be added in the text attribute. Imo the input shouldn't be formatted further, as it's already intended correctly and every attribute is on its own line.

Formatter Implementation

Which XML Formatter implementation are you using (the value of your xmlTools.xmlFormatterImplementation setting).

v2

XML Tools Version

What version of XML Tools are you using?

2.2.0

VS Code Version

What version of VS Code are you using?

1.23.1

Operating System

What OS (and version) are you using?

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions