To reproduce:
- Set in editor
config.pasteFromWordRemoveFontStyles=false;
config.pasteFromWordRemoveStyles=false;
- Open attached file and paste contents into editor
- 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.
It seems there is a better way - adding this particular rule to black list.