Opened 6 years ago

Closed 2 years ago

Last modified 2 years ago

#9422 closed Bug (fixed)

Paste from word leave unwanted color:windowtext

Reported by: Jakub Ś Owned by: Jakub Ś
Priority: Normal Milestone: CKEditor 4.6.0
Component: Plugin : Paste from Word Version: 3.0
Keywords: Cc:

Description

To reproduce:

  1. Set in editor
    config.pasteFromWordRemoveFontStyles=false;
    config.pasteFromWordRemoveStyles=false;
    
  2. Open attached file and paste contents into editor
  3. Switch toSource.

Result: there is span with color:windowtext

<span style="color:windowtext;

A quick workaround is is to set in \ckeditor\_source\plugins\pastefromword\filter\default.js; Lines: 1322-1330 instead of:

data = data.replace( /cke:.*?".*?"/g, '' );
// Remove empty style attribute.
data = data.replace( /style=""/g, '' );
// Remove the dummy spans ( having no inline style ).
data = data.replace( /<span>/g, '' );

The below:

data = data.replace( /cke:.*?".*?"/g, '' );
data = data.replace(/color(\s*):(\s*)windowtext(;?)/g, '');//added
// Remove empty style attribute.
data = data.replace( /style=""/g, '' );		
// Remove the dummy spans ( having no inline style ).
data = data.replace( /<span(\s*)>/g, '' );//changed

but there is probably a much better way to do it.

Attachments (2)

for_cke.docx (35.0 KB) - added by Jakub Ś 6 years ago.
9422.patch (825 bytes) - added by Jakub Ś 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Jakub Ś

Attachment: for_cke.docx added

comment:1 Changed 6 years ago by Jakub Ś

Status: newconfirmed

Changed 6 years ago by Jakub Ś

Attachment: 9422.patch added

comment:2 Changed 6 years ago by Jakub Ś

Owner: set to Jakub Ś
Status: confirmedreview

It seems there is a better way - adding this particular rule to black list.

comment:3 Changed 5 years ago by Frederico Caldeira Knabben

Component: Core : PastingPlugin : Paste from Word

comment:4 Changed 2 years ago by Tade0

Resolution: fixed
Status: reviewclosed

Fixed with new Paste From Word plugin in 4.6.0.

comment:5 Changed 2 years ago by Anna Tomanek

Milestone: CKEditor 4.6.0
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy