Opened 9 years ago

Closed 9 years ago

#13810 closed Bug (invalid)

Styling lost when pasting from word in IE9/10

Reported by: Theun Owned by:
Priority: Normal Milestone:
Component: Plugin : Paste from Word Version:
Keywords: Cc:

Description

Problem

On some computers the paste from word option loses some or all formatting in IE9 and IE10. We have a virtual machine with IE9 and another with IE10 for testing purposes. When I copy formatted text (Header, bold & italic) and paste it in CKEditor, the formatting is preserved. However when a colleage copies the same text from the same document to the CKEditor in the same virtual machine, he loses some or all of his formatting. We have tested on 5 different machines; of which 2 show the problem. All are running the exact same build of windows 7 and word 2007. Our clients can also reproduce this problem on their production setting, and the problem also occurs on ckeditor.com/demo. We are unable to determine an exact reproduction path. Note that when the problem occurs, we lose heading and bold text, but not italic text. Even more strange: Bold italic text is also preserved.

Steps to reproduce

  1. Make a simple word document with a heading 1, a bold text and an italic text
  2. Copy the entire content
  3. Paste in CKEditor in IE9 or IE10 (either with the paste-from-word button or via ctrl+v)

Expected result

The text is pasted with all formatting

Actual result

The header and bold formatting is lost

Other details (browser, OS, CKEditor version, installed plugins)

Source: Windows 7 professional build 7601 Word 2007 (12.0.6727.5000) SP3 MSO (12.0.6728.5000) Destination: Windows 7 professional build 7601 IE9 9.0.8112.16421 CKEditor 4.5.3

We have checked if there is already a difference in the content when on the clipboard with a clipboardviewer. In both the working situation as in the problem situation, the styling is present (see fragment below). The only difference was the flag <w:DoNotShowPropertyChanges/> in the head.

<h1><a name="OLE_LINK2"></a><a name="OLE_LINK1"><span style='mso-bookmark:OLE_LINK2'>Header</span></a></h1> <p class=MsoNormal><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark: OLE_LINK2'><b style='mso-bidi-font-weight:normal'>Bold<o:p></o:p></b></span></span></p> <p class=MsoNormal><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark: OLE_LINK2'><i style='mso-bidi-font-style:normal'>Italic<o:p></o:p></i></span></span></p> <p class=MsoNormal><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark: OLE_LINK2'><u>Underlined<o:p></o:p></u></span></span></p> <p class=MsoNormal><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark: OLE_LINK2'><b style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style: normal'><u>Alles<o:p></o:p></u></i></b></span></span></p> <h1><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark:OLE_LINK2'>Nog een header</span></span></h1> <p class=MsoNormal><span style='mso-bookmark:OLE_LINK1'><span style='mso-bookmark: OLE_LINK2'>Gewoon</span></span></p>

Attachments (3)

test.docx (10.4 KB) - added by Theun 9 years ago.
Test word file
htmlformat.txt (22.8 KB) - added by Theun 9 years ago.
Full clipboard content
screenshot.png (136.3 KB) - added by Theun 9 years ago.
Paste result

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Theun

Attachment: test.docx added

Test word file

Changed 9 years ago by Theun

Attachment: htmlformat.txt added

Full clipboard content

Changed 9 years ago by Theun

Attachment: screenshot.png added

Paste result

comment:1 Changed 9 years ago by Jakub Ś

Keywords: paste from word styling lost IE9 removed
Resolution: invalid
Status: newclosed
Version: 4.5.4

However when a colleage copies the same text from the same document to the CKEditor in the same virtual machine, he loses some or all of his formatting.

If it works on one computer but doesn't on the other, you need to look for differences in your browser settings most likely.

Are you by any chance using some IE custom plugins that might influence that? Perhaps browser’s cache hasn’t been cleared properly?


To not lose the formatting from word you need to do set these two options to false: pasteFromWordRemoveFontStyles : false , pasteFromWordRemoveStyles : false.

Another thing are Advanced Content Filter (ACF) settings.
When pasting your Word file in standard editor demo the only thing that doesn't work for me and the only thing that shouldn't work on every computer is underline. This is because the underline feature is not enabled (is not reported to ACF).

By default every plugin which will be used in CKEditor reports its content to ACF. Thanks to that you can control what types of tags users will use. You can also report other content for the editor or allow all of it.

To learn more about ACF please see:
http://docs.ckeditor.com/#!/guide/dev_acf
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/guide/dev_disallowed_content
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
http://nightly.ckeditor.com/14-03-20-07-05/full/samples/datafiltering.html


To summarize: If you have same settings and they work differently on different computers the only thing that might be causing problems are browser differences. Please check browsers settings or custom plugins. Please also clear IE cache (this is not Ctrl+F5 which is cache refresh)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy