File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ class ToSlateVisitor {
110110 processChildNodes ( thing ) {
111111 const result = [ ] ;
112112 if ( ! thing . nodes ) {
113- throw new Error ( `Node ${ thing . getType ( ) } doesn't have any children!` ) ;
113+ thing . nodes = [ ] ; // Treat no nodes as empty array of nods
114114 }
115115
116116 thing . nodes . forEach ( node => {
Original file line number Diff line number Diff line change @@ -2098,6 +2098,10 @@ Object {
20982098 },
20992099 ],
21002100 },
2101+ Object {
2102+ " $class" : " org.accordproject.commonmark.Item" ,
2103+ " nodes" : Array [],
2104+ },
21012105 ],
21022106 " start" : undefined ,
21032107 " tight" : " true" ,
@@ -2131,6 +2135,7 @@ exports[`slate converts nested-list.json to and from CiceroMark 2`] = `
21312135 - sublist
21322136 - sublist
21332137with some text in the same paragraph
2138+ -
21342139
21352140Epilog
21362141"
@@ -2250,6 +2255,12 @@ Object {
22502255 " object" : " block" ,
22512256 " type" : " list_item" ,
22522257 },
2258+ Object {
2259+ " data" : Object {},
2260+ " nodes" : Array [],
2261+ " object" : " block" ,
2262+ " type" : " list_item" ,
2263+ },
22532264 ],
22542265 " object" : " block" ,
22552266 " type" : " ul_list" ,
@@ -2363,6 +2374,10 @@ Object {
23632374 },
23642375 ],
23652376 },
2377+ Object {
2378+ " $class" : " org.accordproject.commonmark.Item" ,
2379+ " nodes" : Array [],
2380+ },
23662381 ],
23672382 " start" : undefined ,
23682383 " tight" : " true" ,
Original file line number Diff line number Diff line change 116116 ]
117117 }
118118 ]
119+ },
120+ {
121+ "object" : " block" ,
122+ "type" : " list_item" ,
123+ "data" : {},
124+ "nodes" : []
119125 }
120126 ]
121127 }
Original file line number Diff line number Diff line change 44 - sublist
55 - sublist
66with some text in the same paragraph
7+ -
78
89Epilog
You can’t perform that action at this time.
0 commit comments