Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12243 closed Bug (fixed)

Pasting from a Word (type) document loses formatting

Reported by: Alin Purcaru Owned by: Olek Nowodziński
Priority: Normal Milestone: CKEditor 4.4.4
Component: Plugin : Paste from Word Version:
Keywords: Cc:

Description

Description:

When pasting from MS Word, Libre/Open Office documents some of the formatting is lost. Upon checking the HTML generated it can be observed that the style attribute has incorrectly separated definition (missing ';').

Steps to reproduce:

  1. Use the attached test.odt as a sample (although the problem can be reproduced with other formats too).
  2. Click on the Paste from Word button (you will observe that the formatting is kept at this point).
  3. Click OK.
  4. Part of the formatting (in this case the text color for the first paragraph) is lost.

System details:

Ubuntu 14.04, Chrome 35

CKEditor instance config:

CKEDITOR.inline( ... , {
    ...
    allowedContent: true,
    pasteFromWordRemoveFontStyles: false,
    pasteFromWordRemoveStyles: false
});

Note: I have already found the problem and fixed it and will create a pull request for ckeditor/ckeditor-dev on github. I'm posting this bug to have it as reference.

Attachments (1)

test.odt (8.5 KB) - added by Alin Purcaru 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by Alin Purcaru

Attachment: test.odt added

comment:1 Changed 4 years ago by Alin Purcaru

comment:2 Changed 4 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: newassigned

comment:3 Changed 4 years ago by Olek Nowodziński

Resolution: fixed
Status: assignedclosed

I reviewed this PR, which appears to be good. We should not concatenate strings while dealing with styles though. I improved the fix to avoid similar issues in the future.

git:88898049 merged into master.

comment:4 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.4
Version: 4.4.4 (GitHub - master)

comment:5 Changed 4 years ago by Piotrek Koszuliński

As for working with styles we've got a pretty good parser and writer in CKEDITOR.tools. But of course it's hard to start using them everywhere now.

comment:6 Changed 4 years ago by Piotrek Koszuliński

Summary: Pasting from a Word (type) document looses formattingPasting from a Word (type) document loses formatting
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy