@portabletext/editor 3.0.6 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,8 +129,6 @@ describe(parseBlock.name, () => {
129
129
  marks: [],
130
130
  },
131
131
  ],
132
- markDefs: [],
133
- style: 'normal',
134
132
  })
135
133
  })
136
134
 
@@ -160,8 +158,6 @@ describe(parseBlock.name, () => {
160
158
  marks: [],
161
159
  },
162
160
  ],
163
- markDefs: [],
164
- style: 'normal',
165
161
  })
166
162
  })
167
163
 
@@ -271,8 +267,6 @@ describe(parseBlock.name, () => {
271
267
  marks: ['em'],
272
268
  },
273
269
  ],
274
- markDefs: [],
275
- style: 'normal',
276
270
  })
277
271
  })
278
272
 
@@ -301,9 +295,7 @@ describe(parseBlock.name, () => {
301
295
  marks: [],
302
296
  },
303
297
  ],
304
- markDefs: [],
305
298
  listItem: 'bullet',
306
- style: 'normal',
307
299
  })
308
300
  })
309
301
 
@@ -332,8 +324,6 @@ describe(parseBlock.name, () => {
332
324
  marks: [],
333
325
  },
334
326
  ],
335
- markDefs: [],
336
- style: 'normal',
337
327
  })
338
328
  })
339
329
 
@@ -363,8 +353,6 @@ describe(parseBlock.name, () => {
363
353
  marks: [],
364
354
  },
365
355
  ],
366
- markDefs: [],
367
- style: 'normal',
368
356
  })
369
357
  })
370
358
 
@@ -398,8 +386,6 @@ describe(parseBlock.name, () => {
398
386
  marks: [],
399
387
  },
400
388
  ],
401
- markDefs: [],
402
- style: 'normal',
403
389
  })
404
390
  })
405
391
 
@@ -432,8 +418,6 @@ describe(parseBlock.name, () => {
432
418
  marks: [],
433
419
  },
434
420
  ],
435
- markDefs: [],
436
- style: 'normal',
437
421
  })
438
422
  })
439
423
  })
@@ -249,25 +249,20 @@ export function parseTextBlock({
249
249
  _type: context.schema.block.name,
250
250
  _key,
251
251
  children: normalizedChildren,
252
- markDefs: options.removeUnusedMarkDefs
253
- ? markDefs.filter((markDef) => marks.includes(markDef._key))
254
- : markDefs,
255
252
  ...customFields,
256
253
  }
257
254
 
255
+ if (typeof block.markDefs === 'object' && block.markDefs !== null) {
256
+ parsedBlock.markDefs = options.removeUnusedMarkDefs
257
+ ? markDefs.filter((markDef) => marks.includes(markDef._key))
258
+ : markDefs
259
+ }
260
+
258
261
  if (
259
262
  typeof block.style === 'string' &&
260
263
  context.schema.styles.find((style) => style.name === block.style)
261
264
  ) {
262
265
  parsedBlock.style = block.style
263
- } else {
264
- const defaultStyle = context.schema.styles.at(0)?.name
265
-
266
- if (defaultStyle !== undefined) {
267
- parsedBlock.style = defaultStyle
268
- } else {
269
- console.error('Expected default style')
270
- }
271
266
  }
272
267
 
273
268
  if (