+ var pastefilter = 'h2 h3 p ul ol li blockquote em i strong b; a[!href]; img[alt,!src]';
+
+ editor.on('paste', function (e) {
+ var html = e.data.dataValue;
+ if (!/<[^>]* style="/.test(html) && !/<font/.test(html)) return;
+
+ // force pasteFilter on contents containing styling attributes
+ var filter = new CKEDITOR.filter(pastefilter),
+ fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),
+ writer = new CKEDITOR.htmlParser.basicWriter();
+ filter.applyTo(fragment);
+ fragment.writeHtml(writer);
+ e.data.dataValue = writer.getHtml();
+ });
+