Skip to content

Commit

Permalink
fix: handle empty line for pasting multiple line to table
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed Mar 15, 2023
1 parent 39df7ed commit 023ccec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/nodes/Table/TableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export default TableCell.extend({
if (i) {
childNodes.push(state.schema.text('\n'))
}

if (!slice.content.child(i).firstChild) {
continue
}

childNodes.push(state.schema.text(slice.content.child(i).textContent, slice.content.child(i).firstChild.marks))
}
const newNode = view.state.schema.node('paragraph', [], childNodes)
Expand Down

0 comments on commit 023ccec

Please sign in to comment.