mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix: emit a contentError on inserting invalid content
This commit is contained in:
parent
42dc27aa4b
commit
d3e88e791d
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user