ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.79k stars 2.47k forks source link

Paste from Excel doesn't preserve styles #3586

Closed msamsel closed 4 years ago

msamsel commented 5 years ago

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

Comandeer commented 4 years ago

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: https://github.com/ckeditor/ckeditor4/blob/42ff73ab4a546720246f853b593fae874836e427/plugins/pastefromword/plugin.js#L77

Previous version: https://github.com/ckeditor/ckeditor4/blob/64749bb245d1e91f6a4ac4e97c9648ec47acda91/plugins/pastefromword/plugin.js#L64-L71

msamsel commented 4 years ago

@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 commented 4 years ago

Fixed with https://github.com/ckeditor/ckeditor4/commit/2f7937f5ff4b578bdc3e5d3b9ebc265d304ac8ef.