mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-08 01:53:04 +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,
|
errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck,
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} 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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user