diff --git a/CHANGES.md b/CHANGES.md index 16739a73212..e2b457bc267 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Fixed Issues: * [#13129](http://dev.ckeditor.com/ticket/13129) Fixed: Block widget blurred after drop followed by undo. * [#13468](http://dev.ckeditor.com/ticket/13468): [IE] Fixed: Binding drag&drop `dataTransfer` does not work if `text` data was set in the meantime. * [#13419](http://dev.ckeditor.com/ticket/13419): Fixed: [Auto Link](http://ckeditor.com/addon/autolink) plugin does not encode double quotes in URLs. +* [#13460](http://dev.ckeditor.com/ticket/13460): [IE8] Fixed: Copying inline widgets is broken when the Advanced Content Filter is disabled. ## CKEditor 4.5.1 diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index fb6ffd636ac..a27baa94869 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -2334,7 +2334,9 @@ ']*data-cke-copybin-start="1"[^>]*>.?([\\s\\S]+)]*data-cke-copybin-end="1"[^>]*>.?' + '(?:)?' + '(?:)?' + - '$' + '$', + // IE8 prefers uppercase when browsers stick to lowercase HTML (#13460). + 'i' ); function pasteReplaceFn( match, wrapperHtml ) { diff --git a/tests/plugins/widget/widgetsintegration.js b/tests/plugins/widget/widgetsintegration.js index 5aaa204ce1f..752a131b2d0 100644 --- a/tests/plugins/widget/widgetsintegration.js +++ b/tests/plugins/widget/widgetsintegration.js @@ -1,4 +1,4 @@ -/* bender-tags: widgetcore */ +/* bender-tags: widgetcore, 13460 */ /* bender-include: _helpers/tools.js */ /* global widgetTestsTools */ @@ -668,6 +668,46 @@ } ); }, + // #13460 + 'test pasting a widget with lots of extra markup and mixed HTML case': function() { + var editor = this.editor; + + this.editorBot.setData( '

AAB

', function() { + var widget = getWidgetById( editor, 'w1' ), + html = widget.wrapper.getOuterHtml(); + + editor.widgets.del( widget ); + + editor.focus(); + + var range = editor.createRange(); + range.setStartAt( editor.document.getById( 'p1' ), CKEDITOR.POSITION_BEFORE_END ); + range.collapse( true ); + range.select(); + + editor.once( 'afterPaste', function() { + resume( function() { + var widget = getWidgetById( editor, 'w1' ); + + assert.isTrue( !!widget, 'widget was pasted' ); + assert.areSame( '

ABA

', editor.getData() ); + assert.areSame( widget, editor.widgets.focused, 'widget is selected' ); + } ); + } ); + + // Ensure async. + wait( function() { + editor.execCommand( 'paste', + '' + + '\u200b' + + html + + '\u200b' + + '' + ); + } ); + } ); + }, + 'test copying widget with context': function() { var editor = this.editor;