Skip to content

Commit e480e6f

Browse files
committed
Merge branch 't/13449' into major
2 parents d707084 + 3fe048f commit e480e6f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

core/editable.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2614,9 +2614,13 @@
26142614
optimizeBookmarkNode( endBookmark, 1 );
26152615

26162616
var next;
2617-
while ( ( next = endBookmark.getNext() ) )
2617+
while ( ( next = endBookmark.getNext() ) ) {
26182618
next.insertAfter( startBookmark );
26192619

2620+
// Update startBookmark after insertion to avoid the reversal of nodes (#13449).
2621+
startBookmark = next;
2622+
}
2623+
26202624
if ( isEmpty( merged ) )
26212625
merged.remove();
26222626
}

tests/core/editable/getextracthtmlfromrange.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@
157157
[ '<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>' ],
158158
[ '<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>' ],
159159
[ '<h1><b>{a</b></h1><p>b}</p>', '<h1><b>a</b></h1><p>b</p>', '<h1>[]@!</h1>' ],
160-
[ '<h1>{a</h1><p><b>b}</b></p>', '<h1>a</h1><p><b>b</b></p>', '<h1>[]@!</h1>' ]
160+
161+
// #13449
162+
[ '<h1>{a</h1><p><b>b}</b></p>', '<h1>a</h1><p><b>b</b></p>', '<h1>[]@!</h1>' ],
163+
[ '<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>' ]
161164
],
162165

163166
'inline': [
@@ -372,4 +375,4 @@
372375
// <DEV>
373376
// playground.appendTo( CKEDITOR.document.getBody() );
374377
// </DEV>
375-
} )();
378+
} )();

0 commit comments

Comments
 (0)