Page MenuHomePhabricator

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

Description

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

We should just remove them.

Related Objects

StatusAssignedTask
OpenNone
OpenNone
OpenNone
ResolvedNone
ResolvedAmire80
InvalidNone
OpenAmire80
DeclinedNone
ResolvedPetar.petkovic
ResolvedPetar.petkovic
ResolvedPetar.petkovic
ResolvedPginer-WMF
OpenNone
ResolvedPetar.petkovic
ResolvedPetar.petkovic
ResolvedPetar.petkovic
ResolvedPginer-WMF
Resolvedsanthosh
Resolveddchan
Resolvedsanthosh
Resolvedsanthosh
ResolvedNikerabbit
Opensanthosh
Resolvedsanthosh
ResolvedPginer-WMF
OpenNone
ResolvedPginer-WMF
InvalidNone
ResolvedPetar.petkovic
Resolvedsanthosh
Resolvedsanthosh

Event Timeline

Amire80 created this task.Jul 10 2015, 6:43 AM
Amire80 raised the priority of this task from to Low.
Amire80 updated the task description. (Show Details)
Amire80 added a subscriber: Amire80.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2015, 6:43 AM
Pginer-WMF moved this task from CX6 to CX7 on the ContentTranslation board.Jul 21 2015, 4:01 PM
Pginer-WMF set Security to None.
Amire80 moved this task from CX7 to CX6 on the ContentTranslation board.Jul 29 2015, 10:37 PM
Amire80 moved this task from CX6 to CX7 on the ContentTranslation board.Oct 2 2015, 3:58 PM
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 CX7 to Bugs on the ContentTranslation board.Oct 16 2015, 6:56 AM
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.