ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

Pasting into chromium based browsers strips some styling

Open smaclagaibm opened this issue 3 years ago • 5 comments

To reproduce

  1. Rename the attached .txt file to .html
  2. Open in a browser, select all, copy
  3. Open in firefox: https://ckeditor.com/ckeditor-4/demo/#document
  4. Delete all the content in the default Document Editor and paste the previously copied content Note that the pasted content looks the same as the copy source.
  5. Repeat steps 3 and 4 with Chrome (or Safari, or Edge) Note that the pasted content is NOT the same as the copy source.

Font/sizing, colors, horizontal rule, indention are all missing.

This worked on a previous version of CKEditor, 4.4.5. I don't know where between 4.4.5 and 4.19 it stopped working.

index.txt copySource

chrome safari firefox

smaclagaibm avatar Jul 27 '22 22:07 smaclagaibm

And for anyone that's wondering, Red is better than blue because I'm an NCSU graduate and married to a UNC graduate.

smaclagaibm avatar Jul 28 '22 15:07 smaclagaibm

Hi @smaclagaibm - thank you for the report. I can confirm this issue.

Further issue details will be added soon...

sculpt0r avatar Aug 01 '22 07:08 sculpt0r

It's broken since 4.5.0-beta, and of course 4.5.0.

4.4.8 works fine.

sculpt0r avatar Aug 01 '22 08:08 sculpt0r

Sounds right. This was found after upgrading from 4.4.5 to 4.19.

gillibrand avatar Aug 03 '22 20:08 gillibrand

Let's make a git bisect to understand what happened between these versions.

jacekbogdanski avatar Aug 10 '22 08:08 jacekbogdanski

Anyway to get a rough estimate on when this might be prioritized? This is a frustrating regression after I upgraded. Thanks.

gillibrand avatar Sep 02 '22 15:09 gillibrand

This change is connected with the introduction of the paste filter in CKEditor 4.5.0. By default, this filter removes some of the styling in Safari and Chromium-based browsers as they tend to paste too much bloat from the clipboard.

The old behavior can be restored by setting the pasteFilter config variable to null → https://codepen.io/Comandeer/pen/OJZMPVg

Comandeer avatar Sep 07 '22 20:09 Comandeer

@Comandeer Thanks for pointing that out. Yes, that was the problem, and restoring it to "null" goes back to the old behavior. 🙇‍♂️

gillibrand avatar Sep 07 '22 21:09 gillibrand