chylex / IntelliJ-Inspection-Lens

IntelliJ platform plugin that shows errors, warnings, and other inspection highlights inline.
https://plugins.jetbrains.com/plugin/19678-inspection-lens
Mozilla Public License 2.0
57 stars 12 forks source link

Adds unescaping html entities in inspections #3

Closed KostkaBrukowa closed 2 years ago

KostkaBrukowa commented 2 years ago

Some of the eslint errors are formatted as an html code and some of special characters are encoded as html entities. StringUtil.unescapeXmlEntities converts entities to normal characters.

Before (see this "): Screenshot 2022-10-03 at 09 11 01

After: Screenshot 2022-10-03 at 10 14 20

chylex commented 2 years ago

Hi, thanks for the PR! Just a few minor things:

If you want, I can make the changes and force-push into your branch before I merge, or you can do it yourself; let me know.

I'm also interested in what's the standard for inspection descriptions, I didn't consider the possibility of them having HTML entities. I'll investigate how IDEA renders them to make sure the solution is consistent with that.

chylex commented 2 years ago

Looks like IDEA renders inspection descriptions as HTML, so this solution looks fine but does not cover every case.

StringUtil.unescapeXmlEntities does not unescape entities with numeric codes except for ', but I'd say that's fine until someone finds an inspection that uses other numeric codes.

Once this is merged in, I will also strip HTML tags before the entities are unescaped, that should be enough.

KostkaBrukowa commented 2 years ago

Thanks for review! I've changed the line and changed the commit name