mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
fix: use a faster type check for determining if a fragment or not
This commit is contained in:
parent
3d3263911f
commit
aee15c2874
@ -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 }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user