Page MenuHomePhabricator

Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags in IE
Closed, ResolvedPublic

Description

Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags.

We should just remove them.

Related Objects

StatusSubtypeAssignedTask
OpenNone
DuplicateNone
DuplicateNone
Resolvedsanthosh
ResolvedEsanders
ResolvedNone
InvalidNone
Declined Jsahleen
DuplicateNone
ResolvedNone
ResolvedAmire80
InvalidNone
ResolvedPginer-WMF
DeclinedNone
Resolved Petar.petkovic
Resolved Petar.petkovic
Resolved Petar.petkovic
ResolvedPginer-WMF
OpenNone
Resolved Petar.petkovic
Resolved Petar.petkovic
Resolved Petar.petkovic
ResolvedPginer-WMF
Resolvedsanthosh
Resolveddchan
Resolvedsanthosh
Resolvedsanthosh
ResolvedNikerabbit
OpenNone
Resolvedsanthosh
ResolvedPginer-WMF
OpenNone
ResolvedPginer-WMF
InvalidNone
Resolved Petar.petkovic
Resolvedsanthosh
Resolvedsanthosh
OpenNone
ResolvedNone
Resolvedsanthosh
Resolvedsanthosh
Resolvedsanthosh
OpenNone

Event Timeline

Amire80 raised the priority of this task from to Low.
Amire80 updated the task description. (Show Details)
Amire80 subscribed.
Amire80 renamed this task from Translating an article in IE may insert a lot of unnecessary <span class="hps"> tags to Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags.Oct 8 2015, 7:08 PM
Amire80 updated the task description. (Show Details)

from IRC:
[02:30] <+edsanders> aharoni, yes - VE has solved this problem
[02:31] <+edsanders> but it's code in our HTML <-> Linear Model converter
[02:31] <+edsanders> we don't really have a function that cleans up HTML per se
[02:34] <+edsanders> but these sorts of bugs are just the tip of the iceberg
[02:35] <+edsanders> in the time it takes you fix 4 or 5 of these you could probably get VE working

Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags.

Are you sure about this? We allow only plain text pasting in CX. Can you add steps to reproduce or any such published article example? Thanks.

Here, I just reproduced it:
https://he.wikipedia.org/wiki/%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:Amire80/%D7%95%D7%99%D7%99%D7%A7%D7%9D_%D7%9E%D7%95%D7%97%D7%9E%D7%93_%D7%91%D7%A9%D7%99%D7%A8

The "hps" is definitely coming from Google Translate. It's possible that Firefox and Chrome are able to remove it upon pasting, and IE pastes with the <span>s.

It looks like you are using clipboardData.getData( 'text/plain' ) and then execCommand to insert only plain text. This should work but you are trusting the browser to do something sensible, which with CE and the clipboard API is never going to end well, especially in IE...

Amire80 moved this task from Bugs to CX8 candidates on the ContentTranslation board.
santhosh renamed this task from Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags to Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags in IE.Dec 16 2015, 4:53 AM

@Amire80, can you check if the issue is still relevant for CX2. With the new editing surface this may be fixed.

Esanders claimed this task.

VE does paste sanitization completely differently to CX1, so the assumption should be that this bug is not present in VE. Please re-open if that is not the case.