Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags.
We should just remove them.
Copying a translation from Google Translate inserts a lot of unnecessary <span class="hps"> tags.
We should just remove them.
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...
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.