prosemirror-utils
prosemirror-utils copied to clipboard
Add new method to copy rows in a table with configurable options
Deprecated the cloneRowAt
and added a configurable method to copy a row in table copyRow
.
The copyRow
will make this behavior possible:
with this code:
copyRow(5, 4, {
expandRowspanFromClonedRow: false,
keepColspan: true,
getNewCell(cell) {
// We can do anything here, even add a new content if we want to
return cell.type.createAndFill({ background: cell.attrs.background });
},
})(state.tr)
cloneRowAt
is being deprecated because is an inflexible function with a strong opinative logic,
by default with same table we have only this behavior: