Skip to content

Commit

Permalink
fix: isPortableTextBlock not accounting for markDefs: undefined
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
spacedawwwg authored Aug 6, 2023
1 parent 12e86ed commit 4e3cb5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/asserters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function isPortableTextBlock(
// Toolkit-types like nested spans are @-prefixed
node._type[0] !== '@' &&
// `markDefs` isn't _required_ per say, but if it's there, it needs to be an array
(!('markDefs' in node) ||
!node.markDefs ||
(Array.isArray(node.markDefs) &&
// Every mark definition needs to have an `_key` to be mappable in child spans
node.markDefs.every((def) => typeof def._key === 'string'))) &&
Expand Down

0 comments on commit 4e3cb5b

Please sign in to comment.