belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 98 forks source link

Xml - strict whitespace leads to some weird formatting #1361

Open belav opened 1 month ago

belav commented 1 month ago

Because CSharpier currently treats all xml as strict whitespace we end up with the formatting below.

Should strict whitespace be configurable?

The first case should at least be considered a bug, and the starting/ending tags not broken.

<Root>
  <Element Attribute="SomeValue"
    >
    Because whitespace is strict
    The indentation of the closing element can't change
      </Element
  >
  <Element>
    Shorter Text with indentation that can't change
    </Element>
</Root>