@@ -101,6 +101,12 @@ const DefaultBlockStyles = {
101
101
code : 'CODE'
102
102
} ;
103
103
104
+ // Remarkable blocks that stands alone.
105
+ const DefaultRemarkableSingletons = [
106
+ 'hr' ,
107
+ 'fence' ,
108
+ ]
109
+
104
110
// Key generator for entityMap items
105
111
var idCounter = - 1 ;
106
112
function generateUniqueKey ( ) {
@@ -229,6 +235,7 @@ function markdownToDraft(string, options = {}) {
229
235
const BlockTypes = Object . assign ( { } , DefaultBlockTypes , options . blockTypes || { } ) ;
230
236
const BlockEntities = Object . assign ( { } , DefaultBlockEntities , options . blockEntities || { } ) ;
231
237
const BlockStyles = Object . assign ( { } , DefaultBlockStyles , options . blockStyles || { } ) ;
238
+ const RemarkableSingletons = DefaultRemarkableSingletons . concat ( options . remarkableSingletons )
232
239
233
240
parsedData . forEach ( function ( item ) {
234
241
// Because of how remarkable's data is formatted, we need to cache what kind of list we're currently dealing with
@@ -254,7 +261,7 @@ function markdownToDraft(string, options = {}) {
254
261
255
262
// The entity map is a master object separate from the block so just add any entities created for this block to the master object
256
263
Object . assign ( entityMap , blockEntities ) ;
257
- } else if ( ( itemType . indexOf ( '_open' ) !== - 1 || itemType === 'fence' || itemType === 'hr' ) && BlockTypes [ itemType ] ) {
264
+ } else if ( ( itemType . indexOf ( '_open' ) !== - 1 || RemarkableSingletons . includes [ itemType ] ) && BlockTypes [ itemType ] ) {
258
265
var depth = 0 ;
259
266
var block ;
260
267
0 commit comments