Skip to content

Commit

Permalink
Merge branch 't/13449' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Jun 22, 2015
2 parents d707084 + 3fe048f commit e480e6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion core/editable.js
Expand Up @@ -2614,9 +2614,13 @@
optimizeBookmarkNode( endBookmark, 1 );

var next;
while ( ( next = endBookmark.getNext() ) )
while ( ( next = endBookmark.getNext() ) ) {
next.insertAfter( startBookmark );

// Update startBookmark after insertion to avoid the reversal of nodes (#13449).
startBookmark = next;
}

if ( isEmpty( merged ) )
merged.remove();
}
Expand Down
7 changes: 5 additions & 2 deletions tests/core/editable/getextracthtmlfromrange.js
Expand Up @@ -157,7 +157,10 @@
[ '<p>a{b</p><p>c</p><p>}d</p>', '<p>b</p><p>c</p><br data-cke-eol="1" />', '<p>a[]d</p>' ],
[ '<p>ab{</p><p>c</p><p>}de</p>', '<br data-cke-eol="1" /><p>c</p><br data-cke-eol="1" />', '<p>ab[]de</p>' ],
[ '<h1><b>{a</b></h1><p>b}</p>', '<h1><b>a</b></h1><p>b</p>', '<h1>[]@!</h1>' ],
[ '<h1>{a</h1><p><b>b}</b></p>', '<h1>a</h1><p><b>b</b></p>', '<h1>[]@!</h1>' ]

// #13449
[ '<h1>{a</h1><p><b>b}</b></p>', '<h1>a</h1><p><b>b</b></p>', '<h1>[]@!</h1>' ],
[ '<h1>{abc</h1><p><strong>de</strong>gh}<strong>jl</strong>mn</p>', '<h1>abc</h1><p><strong>de</strong>gh</p>', '<h1>[]<strong>jl</strong>mn</h1>' ]
],

'inline': [
Expand Down Expand Up @@ -372,4 +375,4 @@
// <DEV>
// playground.appendTo( CKEDITOR.document.getBody() );
// </DEV>
} )();
} )();

0 comments on commit e480e6f

Please sign in to comment.