Skip to content

Preserve spacing in string literal within element #478

Closed
@kendrickw

Description

I'm reopening this issue #138 .

I'm suggesting a new option (preserveSignificantWhitespace: true/false) to preserve "Significant Whitespace" within XML element and attributes. (As shown by the green spaces in the diagram below)

To clarify, I found a nice description of different types of white space in XML at https://www.liquid-technologies.com/XML/Whitespace.aspx, and I copy the relevant picture here for clarity.

image

What prettier/plugin-xml needs is a mode where it allows itself to reformat red and blue white space, while never modifying green whitespace.

Originally posted by @sbidoul in #138 (comment)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions