Bug 1014672 - & character translated to & r=mikedeboer

This commit is contained in:
Felipe Gomes 2014-06-05 14:52:40 -03:00
parent d4516e53a4
commit 84208ccd86

View File

@ -156,9 +156,16 @@ this.BingTranslation.prototype = {
let error = false;
for (let i = 0; i < len; i++) {
try {
bingRequest.translationData[i][0].parseResult(
results[i].firstChild.nodeValue
);
let result = results[i].firstChild.nodeValue;
let root = bingRequest.translationData[i][0];
if (root.isSimpleRoot) {
// Workaround for Bing's service problem in which "&" chars in
// plain-text TranslationItems are double-escaped.
result = result.replace("&amp;", "&", "g");
}
root.parseResult(result);
} catch (e) { error = true; }
}