roana0229/android-xml-sorter

XML entities are replaced with corresponding character

Closed this issue ยท 3 comments

I'm not sure if it's intended, but XML entities are replaced with their corresponding charachter during rearrangement.

For example, I substituted an en dash in my strings.xml with – to prevent confusion with the normal dash.

Before rearrangement:

<string name="timePeriod">27.09.2017, 10:00 &#8211; 27.09.2017, 11:00</string>

After rearrangement:

<string name="timePeriod">27.09.2017, 10:00 โ€“ 27.09.2017, 11:00</string>

Can you please include an option in the popup dialog to disable this behaviour if this is actually intended.

Thanks!

Hi @xvlcw

Before rearrangement:
27.09.2017, 10:00 &#8211; 27.09.2017, 11:00
After rearrangement:
27.09.2017, 10:00 โ€“ 27.09.2017, 11:00

This is not intended. I will fix problem.
But, I may take time for fix.

Thanks issue !

@xvlcw
I investigated this and I thought not bug.

XML have "numeric character references" and "string entity references".
IntelliJ IDE can't refer a part of "string entity references", and convert it to actual on default.

- and &#8211; is same mean on XML.
Why do you use &#8211; (numeric character reference) ?

Example...

actual string 10 numeric 16 numeric
> &lt; &#60; &#x3C;
- &ndash; &#8211; &#x2013;

> can refer all references, and &lt;&#60;&#x3C; replaced to &lt;&lt;&lt;.
- can't refer &ndash;, and &#8211;&#x2013; replaced to --.

In my opinion.
Make a list of actual condition and "numeric character references" that IntelliJ IDE can't refer a part of "string entity references".
Add option that actual condition convert to "numeric character references".
You can solve the problem.
But, all actual condition are converted. It's not good. ๐Ÿค”

@xvlcw I will close after 3 days if no response. ๐Ÿ˜“ ๐Ÿ™