Closed christopher-fabian closed 10 months ago
Hello,
Escaping those characters are per XML standards. Just to confirm the special characters you are concerned about are >
and <
only, right? I will see if it can be implemented though. Could you please provide couple of sample XMLs to test?
Hi @pmahend1 ,
FYI: In our cases the XMLs are UI-Views and the underlying framework is using some kind "expression binding". The content of the files e.g. look like this:
<View>
<Content>
<Label text="{i18n>LabelText}" />
<Input id="Input1"
value="{service>description}" />
</Content>
</View>
After XML prettify it looks like this and the expression binding is no longer working.
<View>
<Content>
<Label text="{i18n>LabelText}" />
<Input id="Input1"
value="{service>description}" />
</Content>
</View>
The default "Format Document" of VS Code is not escaping >
and <
perhaps due to such cases.
Best regards
Thanks for confirming. I will look into it for adding an option
@christopher-fabian I am in the process of adding that replacement. Do you have an example where <
is part of an attribute value. As soon as I try to add it ,XML becomes invalid. I was able to use your above example to work on >
replacement.
Hi @pmahend1 ,
oh you're right, that seems like a case that will never happen cause it invalidates the XML anyway. This probably doesn't need any further attention.
Best regards
@christopher-fabian So for now, we just want to unescape >
characters in attribute values, right? I can release it later today.
This would be enough for me, thank you! 👍
Addressed with https://github.com/pmahend1/PrettyXML/pull/132
Hi,
Pretty XML replaces special characters in attribute values for e.g. '>' / '<' automatically with '>' / '<'. We don't want this replacing in our team but there is no setting for turning this behaviour off. Is there any chance that you implement a setting for this purpose in a future release?
Best regards