Skip to content

Commit

Permalink
fix: emit a contentError on inserting invalid content
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Aug 6, 2024
1 parent 2d28bf5 commit b858edd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/commands/insertContentAt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export const insertContentAt: RawCommands['insertContentAt'] = (position, value,
errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck,
})
} catch (e) {
editor.emit('contentError', {
editor,
error: e as Error,
disableCollaboration: () => {
console.error('[tiptap error]: Unable to disable collaboration at this point in time')
},
})
return false
}

Expand Down

0 comments on commit b858edd

Please sign in to comment.