New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paste from Libre Office changes the behaviour of paste filter #3809
Comments
It looks like a serious regression 😭 From what I understand, we are not able to differentiate content pasted from Libre Office in Safari and IE. The Questions:
🤔 TBH looks like a hard case since we are not able to distinguish from what source the content was pasted... |
The check is not browser specific. We could narrow down the scope of the issue, but still the problematic scenario might appear on Safari and IE: ckeditor4/plugins/pastefromlibreoffice/plugin.js Lines 44 to 45 in 01b82d9
Without meta information in clipboard it won't be possible to distinguish content copied from website from content copied from Libre Office :(
However this might result with stripping styles pasted from libre office when those are not defined in pasteFilter. |
So theoretically we could narrow it down to Safari and IE11 (and older IEs probably) 🤔 For now ckeditor4/plugins/pastefromlibreoffice/plugin.js Lines 33 to 45 in 01b82d9
which might result on cases like the above 🤔 So narrowing it down seems like resolving the issue at least on some browsers.
So it means we couldn't properly handle it on Safari? 😨 And we have to choose between handling correctly Libre Office content and regression to filtering? 😬 |
Yes. Take a look at clipboard data obtained on Safari for a content with a simple one paragraph: Line 1 in 01b82d9
Content looks like a regular paragraph with a bunch of attributs. None of them seems to be LibreOffice specific, what could allow to distinguish this content from regular copy-paste of an html data. For Chrome data contains Lines 1 to 15 in 01b82d9
|
Ok, my proposal is as follows:
WDYT @Comandeer? @jacekbogdanski any thought on this one? |
Not sure, you probably wrote the same, but if it's only Safari and IE11 (older?) problem - maybe let's just disable PFLO feature for these browsers? We can go with some deeper research later if we can introduce PFLO without regressions for these browsers. We can even treat #3646 as a replacement/workaround. |
Both PfLO and PfW explicitly disable paste filter:
If we're going to use What's more, switching on filter produces very poor results. Content pasted in Chrome with paste filter switched on:
I doubt it. Safari won't expose any metadata (it was already a case in GDocs → #3257 (comment)) and LO produces too clean HTML to be able to detect it. |
@Comandeer @jacekbogdanski so we basically have a choice between disabling PfLO completely for Safari (as @Comandeer mentioned it's highly improbable something will change in Safari) or go with poor version due to how Safari internally works (mentioning this case in the docs). Eventually, we could go with #3646 but I doubt we will be able to cover it in a foreseeable future. |
After F2F talk with @jacekbogdanski and @Comandeer we have decided that PfLO should be disabled for Safari for now and we will enable it whenever #3646 will be covered. Leaving this issue open for future reference. |
Type of report
Bug
Provide detailed reproduction steps (if any)
span
.major
branch.span
.Expected result
Styles are not preserved (you can see expected result by pasting into the editor inside the pen).
Actual result
Background and font color are preserved.
Other details
In Chrome and Safari paste filter is set by default to
semantic-content
, to tidy the polluted HTML produced by these browsers. However the inability to detect the source of paste in Safari and IE resulted in the general filter in PfLO, which changes the behaviour of default paste filter in Blink and WebKit.major
pastefromlibreoffice
The text was updated successfully, but these errors were encountered: