Skip to content

Commit 765a28c

Browse files
committed
Merge branch 't/12729b'
2 parents e8a747d + 6b15c0e commit 765a28c

File tree

8 files changed

+274
-55
lines changed

8 files changed

+274
-55
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Fixed Issues:
1111
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after *enter* key pressed in nested list.
1212
* [#13027](http://dev.ckeditor.com/ticket/13027): Fixed: Keyboard Navigation in dialogs with multiple tabs not following CI 162 instructions or [ARIA Authoring practices](http://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel).
1313
* [#12256](http://dev.ckeditor.com/ticket/12256): Fixed: Basic styles' classes are lost when pasting from MS Word if [basics styles](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-coreStyles_bold) were configured to use classes.
14+
* [#12729](http://dev.ckeditor.com/ticket/12729): Incorrect structure created when merging block into list item on *Backspace* and *Delete*.
1415

1516
Other Changes:
1617

plugins/list/plugin.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,9 @@
907907
joinWith = previous;
908908
// Place cursor at the end of previous block.
909909
cursor.moveToElementEditEnd( joinWith );
910+
911+
// And then just before end of closest block element (#12729).
912+
cursor.moveToPosition( cursor.endPath().block, CKEDITOR.POSITION_BEFORE_END );
910913
}
911914
}
912915

@@ -971,7 +974,7 @@
971974
}
972975
// Right at the end of list item.
973976
else if ( range.checkBoundaryOfElement( block, CKEDITOR.END ) ) {
974-
isAtEnd = 1;
977+
isAtEnd = 2;
975978
}
976979

977980

@@ -980,6 +983,16 @@
980983
nextLine = range.clone();
981984
nextLine.moveToElementEditStart( next );
982985

986+
// Moving `cursor` and `next line` only when at the end literally (#12729).
987+
if ( isAtEnd == 2 ) {
988+
cursor.moveToPosition( cursor.endPath().block, CKEDITOR.POSITION_BEFORE_END );
989+
990+
// Next line might be text node not wrapped in block element.
991+
if ( nextLine.endPath().block ) {
992+
nextLine.moveToPosition( nextLine.endPath().block, CKEDITOR.POSITION_AFTER_START );
993+
}
994+
}
995+
983996
joinNextLineToCursor( editor, cursor, nextLine );
984997
evt.cancel();
985998
}

tests/_benderjs/ckeditor/static/tools.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,12 @@
329329
* // Then test will look like:
330330
* bender.testInputOut( 'sample1', function( input, output ){ ...test and assertion... });
331331
*/
332-
testInputOut: function( playground, fn ) {
332+
testInputOut: function( playground, fn, trimSelection ) {
333+
trimSelection = ( trimSelection === false ? false : true );
334+
333335
var source = bender.tools.getValueAsHtml( playground ).split( '=>' ),
334336
input = source[ 0 ],
335-
output = /\(no change\)/.test( source[ 1 ] ) ? input.replace( /\^|\[|\]/g, '' ) : source[ 1 ];
337+
output = /\(no change\)/.test( source[ 1 ] ) ? ( trimSelection ? input.replace( /\^|\[|\]/g, '' ) : input ) : source[ 1 ];
336338

337339
fn( input, output );
338340
},
@@ -1259,6 +1261,11 @@
12591261
fixZWS = ( 'fixZWS' in options ) ? options.fixZWS : true,
12601262
fixNbsp = ( 'fixNbsp' in options ) ? options.fixNbsp : true;
12611263

1264+
// On IE8- we need to get rid of expando attributes.
1265+
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) {
1266+
innerHtml = innerHtml.replace( / data-cke-expando="[^"]*"/g, '' );
1267+
}
1268+
12621269
if ( options.compareSelection ) {
12631270
innerHtml = innerHtml.replace( selectionMarkers, '<!--cke-range-marker-$1-->' );
12641271
}

0 commit comments

Comments
 (0)