plugin-xml icon indicating copy to clipboard operation
plugin-xml copied to clipboard

feat: support option `preserveSignificantWhitespace`

Open kendrickw opened this issue 3 years ago • 0 comments

Fixes #478

Add new option preserveSignificantWhitespace, to preserve significant whitespace within XML elements. This PR should address all the cases where significant white space exists.

Specifically:

  • spaces within string are preserved:

    // before and after prettier identical
    <v>some string    extra space</v>
    
  • string with space(s) at the beginning and/or end:

    // before and after prettier identical
    <v>
      some  string
    </v>
    
  • mixing elements within string literal is also supported, space(s) surrounding and within string literal will be preserved:

    before: <v> some  string<abc/>more string </v>
     after: <v> some  string<abc />more string </v>
    

kendrickw avatar May 18 '22 20:05 kendrickw