OiWorld / MindTheWord

An extension for Google Chrome that helps people learn new languages while they browse the web.
43 stars 47 forks source link

HTML in translations #97

Closed ankit-m closed 8 years ago

ankit-m commented 8 years ago

Link: http://www.amazon.in/OnePlus-2-Sandstone-Black-64GB/dp/B011RG8SOU/ref=sr_1_3?s=electronics&ie=UTF8&qid=1458247333&sr=1-3&keywords=nexus+5x+32gb

Pattern: 75% Chinese to English

Error: HTML in translated text. html_in_translation

ceilican commented 8 years ago

Yes, I have already seen this happening.

Maybe the issue is in the deepHTMLReplacement function. It should apply translations only to words inside text nodes. If translations are applied to tag names or to attributes, as shown in the screenshot in the comment above, then the HTML code will be broken. The browser might then display broken HTML code as text.

deepHTMLReplacement already has many checks (cf. line 32 and 40) to prevent this from happening, but probably these checks are not exhaustive enough.

ceilican commented 8 years ago

Here is another screenshot showing this behaviour:

screen shot 2016-05-06 at 17 11 18 screen shot 2016-05-06 at 17 11 31

These screenshots were provided by Nicholas Kiefer. We should notify him, when this bug is solved.

ceilican commented 8 years ago

Was this issue already solved?

rohankatyal29 commented 8 years ago

@Ceilican - I think so, haven't seen it in the new version even once. In the old one it used to pop up often

ceilican commented 8 years ago

Ok, then I will close it.