Skip to content
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 Excel doesn't preserve styles #3586

Closed
msamsel opened this issue Oct 17, 2019 · 3 comments
Closed

Paste from Excel doesn't preserve styles #3586

msamsel opened this issue Oct 17, 2019 · 3 comments
Assignees
Labels
browser:chrome The issue can only be reproduced in the Chrome browser. browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. plugin:pastefromword The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. support:3 An issue reported by a commercially licensed client. type:bug A bug.
Milestone

Comments

@msamsel
Copy link
Contributor

msamsel commented Oct 17, 2019

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open excel: simple_styles.xlsx
  2. Copy blue table
  3. Paste it in Chrome

Expected result

The background color of the table will be preserved

Actual result

The table is copied without background color

Other details

Issue doesn't occur on 4.12.1

  • Browser: Edge/Chrome
  • OS: Windows10
  • CKEditor version: 4.13.0
  • Installed CKEditor plugins: …
@msamsel msamsel added type:bug A bug. status:confirmed An issue confirmed by the development team. browser:chrome The issue can only be reproduced in the Chrome browser. browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. plugin:pastefromword The plugin which probably causes the issue. regression This issue is a regression. labels Oct 17, 2019
@f1ames f1ames added this to the 4.13.1 milestone Oct 17, 2019
@lslowikowska lslowikowska added support An issue reported by a commercially licensed client. support:1 An issue reported by a commercially licensed client. and removed support An issue reported by a commercially licensed client. labels Oct 17, 2019
@Comandeer Comandeer self-assigned this Nov 11, 2019
@Comandeer
Copy link
Member

It seems that content from Excel is not recognized as Office content and therefore Paste from Word skips parsing it. It also causes #3585 and #3625 even when PfW is enabled.

Probably issue is connected with simplified logic for getting pasted HTML.

Current version:

mswordHtml = data.dataValue,

Previous version:

dataTransferHtml = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ?
data.dataTransfer.getData( 'text/html', true ) : null,
// Required in Paste from Word Image plugin (#662).
dataTransferRtf = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ?
data.dataTransfer.getData( 'text/rtf' ) : null,
// Some commands fire paste event without setting dataTransfer property. In such case
// dataValue should be used.
mswordHtml = dataTransferHtml || data.dataValue,

@msamsel
Copy link
Contributor Author

msamsel commented Nov 12, 2019

@Comandeer AFAIR from work on PFLO. data.dataValue doesn't contain meta tags, there's only body section of a clipboard.
I spot it during work on PFLO and also improve it, as this approach also generated issues for me when both PFLO and PFW was present in editor's config.
https://github.com/ckeditor/ckeditor4/pull/3624/files#diff-9609bf210ad60faf5b8f8f446baf4e1eR77-R83

@f1ames
Copy link
Contributor

f1ames commented Dec 2, 2019

Fixed with 2f7937f.

@f1ames f1ames closed this as completed Dec 2, 2019
@lslowikowska lslowikowska added support:3 An issue reported by a commercially licensed client. and removed support:1 An issue reported by a commercially licensed client. labels Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:chrome The issue can only be reproduced in the Chrome browser. browser:edge The issue can only be reproduced in the Edge (edgeHTML engine based) browser. plugin:pastefromword The plugin which probably causes the issue. regression This issue is a regression. status:confirmed An issue confirmed by the development team. support:3 An issue reported by a commercially licensed client. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

4 participants