fix: use a faster type check for determining if a fragment or not

This commit is contained in:
Nick the Sick 2024-06-03 17:49:31 +02:00 committed by Nick Perez
parent 3d3263911f
commit aee15c2874

View File

@ -57,7 +57,7 @@ declare module '@tiptap/core' {
}
const isFragment = (nodeOrFragment: ProseMirrorNode | Fragment): nodeOrFragment is Fragment => {
return nodeOrFragment.toString().startsWith('<')
return !('type' in nodeOrFragment)
}
export const insertContentAt: RawCommands['insertContentAt'] = (position, value, options) => ({ tr, dispatch, editor }) => {