shedaniel / AutoConfig

Fork of Auto Config.
Apache License 2.0
28 stars 13 forks source link

Disable ugly and unnecessary Gson HTML escaping #24

Open Fourmisain opened 3 years ago

Fourmisain commented 3 years ago

The characters ', =, &, < and > (source) are by default HTML-escaped, so they'll be serialized to something like \u0027. This is absolutely not needed for locally stored config files (and shouldn't be needed even for web applications).

For example, a relatively readable string like %highlight{%msg%n}{FATAL=red, ERROR=red, WARN=normal, INFO=normal, DEBUG=normal, TRACE=normal}" turns into this monstrosity: %highlight{%msg%n}{FATAL\u003dred, ERROR\u003dred, WARN\u003dnormal, INFO\u003dnormal, DEBUG\u003dnormal, TRACE\u003dnormal}

Luckily, the fix is extremely easy and has no downsides. Configs containing such unicode sequences are still decoded correctly and they are even cleanly rewritten.

P.S. I believe I saw an issue about this in one of your projects, will look tomorrow if I can find it. edit Couldn't find the issue, but going through Cloth Config I found that tweed can also disable HTML-escaping

Fourmisain commented 3 years ago

I learned I should set my email author field