angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Corrected overcorrections which caused ampersands to be html-encoded

Open rdeslonde opened this issue 6 years ago • 1 comments

Keys are broken by gettext if they contain ampersands that are not html-encoded. The reason is, gettext uses .html() on keys in a few places, which html-encodes ampersands (among other special characters).

The two places in gettext that break keys with amersands are in directive.js line #99 and in catalog.js line #174.

I've corrected this by comparing the original key to the "overcorrected" key, and where the original did not have an html-encoded ampersand, the html-encoded ampersand is replaced with an unencoded ampersand.

A new function rollBackOvercorrections is used for this correction. Tested and working in a large project with 1500 translated translations.

This PR only fixes ampersands, but other html-encodings can also be fixed with a simple addition to this code.

rdeslonde avatar Mar 18 '18 06:03 rdeslonde

Chrome is crashing during CI for some reason.

rdeslonde avatar Mar 18 '18 08:03 rdeslonde