alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files
MIT License
534 stars 136 forks source link

Indent changes an " into an ' #119

Open richClubb opened 3 years ago

richClubb commented 3 years ago

When performing an Indent XML on sublime it changed the & into a ' when doing the Indent XML.

For example <hello><test1>&apos;</test1></hello>

Gets turned into

<hello>
    <test1>'</test1>
</hello>

But <hello><test1>&quot;</test1></hello>

becomes

<hello>
    <test1>&quot;</test1>
</hello>

I'm pretty sure that the latter is the correct behaviour. This is the same for all the other XML escape sequences, it only effects the & escape sequence

Marchap commented 3 years ago

Glad I'm didn't have to write this! Adding that auto-indent also converts "&#37;" to "%", but doesn't convert "&amp;". If I had a setting, I'd prefer escaped characters weren't converted.