@@ -46,7 +46,9 @@ const testSuite = (getKit: () => Kit) => {
46
46
kit . et . marker ( { action : 'ins' } ) ;
47
47
kit . peritext . refresh ( ) ;
48
48
const html3 = transfer . toHtml ( kit . peritext . rangeAll ( ) ! ) ;
49
- expect ( html3 ) . toBe ( '<p>abcde</p><blockquote><p>fghi</p></blockquote><blockquote><p>jklmnopqrstuvwxyz</p></blockquote>' ) ;
49
+ expect ( html3 ) . toBe (
50
+ '<p>abcde</p><blockquote><p>fghi</p></blockquote><blockquote><p>jklmnopqrstuvwxyz</p></blockquote>' ,
51
+ ) ;
50
52
} ) ;
51
53
52
54
test ( 'can split <p> in list, list item <li> and create two adjacent lists' , async ( ) => {
@@ -75,25 +77,51 @@ const testSuite = (getKit: () => Kit) => {
75
77
test ( 'can consecutively split two nested lists with a blockquote' , async ( ) => {
76
78
const kit = setup ( ) ;
77
79
kit . et . cursor ( { at : 7 } ) ;
78
- kit . et . marker ( { action : 'ins' , type : [ SliceTypeCon . ul , SliceTypeCon . li , SliceTypeCon . ul , SliceTypeCon . li , SliceTypeCon . blockquote , SliceTypeCon . p ] } ) ;
80
+ kit . et . marker ( {
81
+ action : 'ins' ,
82
+ type : [
83
+ SliceTypeCon . ul ,
84
+ SliceTypeCon . li ,
85
+ SliceTypeCon . ul ,
86
+ SliceTypeCon . li ,
87
+ SliceTypeCon . blockquote ,
88
+ SliceTypeCon . p ,
89
+ ] ,
90
+ } ) ;
79
91
kit . peritext . refresh ( ) ;
80
92
const transfer = createTransfer ( kit . peritext ) ;
81
93
const html1 = transfer . toHtml ( kit . peritext . rangeAll ( ) ! ) ;
82
- expect ( html1 ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmnopqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
94
+ expect ( html1 ) . toBe (
95
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmnopqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
96
+ ) ;
83
97
kit . et . cursor ( { at : 15 } ) ;
84
98
const pressEnter = ( ) : string => {
85
99
kit . et . marker ( { action : 'ins' } ) ;
86
100
kit . peritext . refresh ( ) ;
87
101
const html = transfer . toHtml ( kit . peritext . rangeAll ( ) ! ) ;
88
102
return html ;
89
103
} ;
90
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
91
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
92
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
93
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
94
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
95
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
96
- expect ( pressEnter ( ) ) . toBe ( '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p /></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ) ;
104
+ expect ( pressEnter ( ) ) . toBe (
105
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
106
+ ) ;
107
+ expect ( pressEnter ( ) ) . toBe (
108
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
109
+ ) ;
110
+ expect ( pressEnter ( ) ) . toBe (
111
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
112
+ ) ;
113
+ expect ( pressEnter ( ) ) . toBe (
114
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
115
+ ) ;
116
+ expect ( pressEnter ( ) ) . toBe (
117
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
118
+ ) ;
119
+ expect ( pressEnter ( ) ) . toBe (
120
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
121
+ ) ;
122
+ expect ( pressEnter ( ) ) . toBe (
123
+ '<p>abcdefg</p><ul><li><ul><li><blockquote><p>hijklmn</p></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p /></blockquote></li></ul></li></ul><ul><li><ul><li><blockquote><p>opqrstuvwxyz</p></blockquote></li></ul></li></ul>' ,
124
+ ) ;
97
125
} ) ;
98
126
} ;
99
127
0 commit comments