File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
import Parchment from 'parchment' ;
2
2
import Emitter from '../core/emitter' ;
3
3
import Block , { BlockEmbed } from './block' ;
4
+ import Break from './break' ;
4
5
import Container from './container' ;
5
6
import CodeBlock from '../formats/code' ;
6
7
@@ -32,7 +33,8 @@ class Scroll extends Parchment.Scroll {
32
33
if ( last instanceof CodeBlock ) {
33
34
last . deleteAt ( last . length ( ) - 1 , 1 ) ;
34
35
}
35
- first . moveChildren ( last , last . children . head ) ;
36
+ let ref = last . children . head instanceof Break ? null : last . children . head ;
37
+ first . moveChildren ( last , ref ) ;
36
38
first . remove ( ) ;
37
39
}
38
40
this . optimize ( ) ;
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ describe('Block', function() {
52
52
expect ( scroll . domNode ) . toEqualHTML ( '<h2>HelloWorld!</h2>' ) ;
53
53
} ) ;
54
54
55
+ it ( 'join line with empty' , function ( ) {
56
+ let scroll = this . initialize ( Scroll , '<p>Hello<strong>World</strong></p><p><br></p>' ) ;
57
+ scroll . deleteAt ( 10 , 1 ) ;
58
+ expect ( scroll . domNode ) . toEqualHTML ( '<p>Hello<strong>World</strong></p>' ) ;
59
+ } ) ;
60
+
55
61
it ( 'join empty lines' , function ( ) {
56
62
let scroll = this . initialize ( Scroll , '<h1><br></h1><p><br></p>' ) ;
57
63
scroll . deleteAt ( 1 , 1 ) ;
You can’t perform that action at this time.
0 commit comments