Skip to content

Commit

Permalink
Merge branch 't/12729b'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Mar 27, 2015
2 parents e8a747d + 6b15c0e commit 765a28c
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 55 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Fixed Issues:
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after *enter* key pressed in nested list.
* [#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).
* [#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.
* [#12729](http://dev.ckeditor.com/ticket/12729): Incorrect structure created when merging block into list item on *Backspace* and *Delete*.

Other Changes:

Expand Down
15 changes: 14 additions & 1 deletion plugins/list/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,9 @@
joinWith = previous;
// Place cursor at the end of previous block.
cursor.moveToElementEditEnd( joinWith );

// And then just before end of closest block element (#12729).
cursor.moveToPosition( cursor.endPath().block, CKEDITOR.POSITION_BEFORE_END );
}
}

Expand Down Expand Up @@ -971,7 +974,7 @@
}
// Right at the end of list item.
else if ( range.checkBoundaryOfElement( block, CKEDITOR.END ) ) {
isAtEnd = 1;
isAtEnd = 2;
}


Expand All @@ -980,6 +983,16 @@
nextLine = range.clone();
nextLine.moveToElementEditStart( next );

// Moving `cursor` and `next line` only when at the end literally (#12729).
if ( isAtEnd == 2 ) {
cursor.moveToPosition( cursor.endPath().block, CKEDITOR.POSITION_BEFORE_END );

// Next line might be text node not wrapped in block element.
if ( nextLine.endPath().block ) {
nextLine.moveToPosition( nextLine.endPath().block, CKEDITOR.POSITION_AFTER_START );
}
}

joinNextLineToCursor( editor, cursor, nextLine );
evt.cancel();
}
Expand Down
11 changes: 9 additions & 2 deletions tests/_benderjs/ckeditor/static/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,12 @@
* // Then test will look like:
* bender.testInputOut( 'sample1', function( input, output ){ ...test and assertion... });
*/
testInputOut: function( playground, fn ) {
testInputOut: function( playground, fn, trimSelection ) {
trimSelection = ( trimSelection === false ? false : true );

var source = bender.tools.getValueAsHtml( playground ).split( '=>' ),
input = source[ 0 ],
output = /\(no change\)/.test( source[ 1 ] ) ? input.replace( /\^|\[|\]/g, '' ) : source[ 1 ];
output = /\(no change\)/.test( source[ 1 ] ) ? ( trimSelection ? input.replace( /\^|\[|\]/g, '' ) : input ) : source[ 1 ];

fn( input, output );
},
Expand Down Expand Up @@ -1259,6 +1261,11 @@
fixZWS = ( 'fixZWS' in options ) ? options.fixZWS : true,
fixNbsp = ( 'fixNbsp' in options ) ? options.fixNbsp : true;

// On IE8- we need to get rid of expando attributes.
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) {
innerHtml = innerHtml.replace( / data-cke-expando="[^"]*"/g, '' );
}

if ( options.compareSelection ) {
innerHtml = innerHtml.replace( selectionMarkers, '<!--cke-range-marker-$1-->' );
}
Expand Down

0 comments on commit 765a28c

Please sign in to comment.