Skip to content

Experimental formatter ignores xml.format.preservedNewlines #797

@kapexx

Description

@kapexx

Thanks for working on the new experimental formatter. I've just tried it on a few documents and compared them to the old formatting. I see a lot differences because the setting xml.format.preservedNewlines seems to be ignored in some cases.

With the setting "xml.format.preservedNewlines": 2 when formatting following document

<foo>

    <bar>1</bar>

    <bar>2</bar>


    <bar>3</bar>



    <bar>4</bar>

</foo>

I would expected this result:

<foo>

    <bar>1</bar>

    <bar>2</bar>


    <bar>3</bar>


    <bar>4</bar>

</foo>

The actual result is:

<foo>
    <bar>1</bar>
    <bar>2</bar>


    <bar>3</bar>


    <bar>4</bar>
</foo>

The three empty lines after <bar>3</bar> collapse into two empty lines as expected. But it looks like all single empty line are removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions