Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected overcorrections which caused ampersands to be html-encoded #352

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

rdeslonde
Copy link

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
Copy link
Author

Chrome is crashing during CI for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant