add createTable
This commit is contained in:
13
packages/extension-table/src/utilities/createCell.ts
Normal file
13
packages/extension-table/src/utilities/createCell.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
NodeType, Fragment,
|
||||
Node as ProsemirrorNode,
|
||||
Schema,
|
||||
} from 'prosemirror-model'
|
||||
|
||||
export function createCell(cellType: NodeType, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>) {
|
||||
if (cellContent) {
|
||||
return cellType.createChecked(null, cellContent)
|
||||
}
|
||||
|
||||
return cellType.createAndFill()
|
||||
}
|
||||
Reference in New Issue
Block a user