csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Xml - don't automatically encode attribute values

Open belav opened this issue 7 months ago • 0 comments

Currently xml attributes are encoded when run through CSharpier, which results in them being less readable.

Input

<Target Name="Transform" BeforeTargets="Build">
  <Message Importance="high" Text="@(MyItems->'MyItems has %(Identity)', ', ')" />
</Target>

Output

<Target Name="Transform" BeforeTargets="Build">
  <Message Importance="high" Text="@(MyItems-&gt;'MyItems has %(Identity)', ', ')" />
</Target>

This happens automatically with XAttribute but the code does make use of that along with the associated XmlAttribute to keep the original new lines in attribute values. Does using only XmlAttribute cause some other issue? Can the code figure out how to keep unencoded values for everything?

belav avatar May 20 '25 14:05 belav