Skip to content
Permalink
Browse files

Merge branch 't/13460'

  • Loading branch information...
Reinmar committed Jul 7, 2015
2 parents 9f81178 + 57b437b commit e561d84e55e9d0f45cf14b4bc261fc145937892f
Showing with 45 additions and 2 deletions.
  1. +1 −0 CHANGES.md
  2. +3 −1 plugins/widget/plugin.js
  3. +41 −1 tests/plugins/widget/widgetsintegration.js
@@ -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

@@ -2334,7 +2334,9 @@
'<span [^>]*data-cke-copybin-start="1"[^>]*>.?</span>([\\s\\S]+)<span [^>]*data-cke-copybin-end="1"[^>]*>.?</span>' +
'(?:</(?:div|span)>)?' +
'(?:</(?:div|span)>)?' +
'$'
'$',
// IE8 prefers uppercase when browsers stick to lowercase HTML (#13460).
'i'
);

function pasteReplaceFn( match, wrapperHtml ) {
@@ -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( '<p id="p1">A<span data-widget="test2" id="w1">A</span>B</p>', 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( '<p id="p1">AB<span data-widget="test2" id="w1">A</span></p>', editor.getData() );
assert.areSame( widget, editor.widgets.focused, 'widget is selected' );
} );
} );

// Ensure async.
wait( function() {
editor.execCommand( 'paste',
'<SPAN style="POSITION: absolute; WIDTH: 1px; HEIGHT: 1px; OVERFLOW: hidden; LEFT: -5000px">' +
'<SPAN data-cke-copybin-start="1" foo="1">\u200b</SPAN>' +
html +
'<SPAN data-cke-copybin-end="1">\u200b</SPAN>' +
'</SPAN>'
);
} );
} );
},

'test copying widget with context': function() {
var editor = this.editor;

0 comments on commit e561d84

Please sign in to comment.
You can’t perform that action at this time.