@@ -43,17 +43,15 @@ describe('.fromHtml()', () => {
43
43
test ( 'can import a single <blockquote> block with nested single <p>' , ( ) => {
44
44
const html = '<blockquote><p>2b||!2b</p></blockquote>' ;
45
45
const peritextMl = fromHtml ( html ) ;
46
- expect ( peritextMl ) . toEqual ( [ '' , null ,
47
- [ CommonSliceType . blockquote , null ,
48
- [ CommonSliceType . p , null , '2b||!2b' ]
49
- ] ,
50
- ] ) ;
46
+ expect ( peritextMl ) . toEqual ( [ '' , null , [ CommonSliceType . blockquote , null , [ CommonSliceType . p , null , '2b||!2b' ] ] ] ) ;
51
47
} ) ;
52
48
53
49
test ( 'can import a single <blockquote> block after a <p> block' , ( ) => {
54
50
const html = '<p>123</p><blockquote>2b||!2b</blockquote>' ;
55
51
const peritextMl = fromHtml ( html ) ;
56
- expect ( peritextMl ) . toEqual ( [ '' , null ,
52
+ expect ( peritextMl ) . toEqual ( [
53
+ '' ,
54
+ null ,
57
55
[ CommonSliceType . p , null , '123' ] ,
58
56
[ CommonSliceType . blockquote , null , '2b||!2b' ] ,
59
57
] ) ;
@@ -62,26 +60,28 @@ describe('.fromHtml()', () => {
62
60
test ( 'can import a single <blockquote> block with nested single <p>, after a <p> block' , ( ) => {
63
61
const html = '<p>123</p><blockquote><p>2b||!2b</p></blockquote>' ;
64
62
const peritextMl = fromHtml ( html ) ;
65
- expect ( peritextMl ) . toEqual ( [ '' , null ,
63
+ expect ( peritextMl ) . toEqual ( [
64
+ '' ,
65
+ null ,
66
66
[ CommonSliceType . p , null , '123' ] ,
67
- [ CommonSliceType . blockquote , null ,
68
- [ CommonSliceType . p , null , '2b||!2b' ]
69
- ] ,
67
+ [ CommonSliceType . blockquote , null , [ CommonSliceType . p , null , '2b||!2b' ] ] ,
70
68
] ) ;
71
69
} ) ;
72
70
73
71
test ( 'can import a single <blockquote> block with nested single <p>, after a <p> block with inline formatting' , ( ) => {
74
72
const html = '<p><b>1</b><code>2</code>3</p><blockquote><p>2b||!2b</p></blockquote>' ;
75
73
const peritextMl = fromHtml ( html ) ;
76
- expect ( peritextMl ) . toEqual ( [ '' , null ,
77
- [ CommonSliceType . p , null ,
74
+ expect ( peritextMl ) . toEqual ( [
75
+ '' ,
76
+ null ,
77
+ [
78
+ CommonSliceType . p ,
79
+ null ,
78
80
[ CommonSliceType . b , { behavior : SliceBehavior . One , inline : true } , '1' ] ,
79
81
[ CommonSliceType . code , { behavior : SliceBehavior . One , inline : true } , '2' ] ,
80
- '3'
81
- ] ,
82
- [ CommonSliceType . blockquote , null ,
83
- [ CommonSliceType . p , null , '2b||!2b' ]
82
+ '3' ,
84
83
] ,
84
+ [ CommonSliceType . blockquote , null , [ CommonSliceType . p , null , '2b||!2b' ] ] ,
85
85
] ) ;
86
86
} ) ;
87
87
} ) ;
0 commit comments