Skip to content

Commit

Permalink
fix: divide the block when pasting text to wysiwyg (nhn#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
js87zz authored Oct 19, 2021
1 parent 0bec4c8 commit 95dfa1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wysiwyg/clipboard/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ function createTableFromPastingTable(rows: Node[], schema: Schema, startFromBody

export function changePastedSlice(slice: Slice, schema: Schema) {
const nodes: Node[] = [];
const { content, openStart, openEnd } = slice;

slice.content.forEach((node) => {
content.forEach((node) => {
if (node.type.name === 'table') {
const tableContent = getTableContentFromSlice(new Slice(Fragment.from(node), 0, 0));

Expand All @@ -174,5 +175,5 @@ export function changePastedSlice(slice: Slice, schema: Schema) {
}
});

return new Slice(Fragment.from(nodes), 0, 0);
return new Slice(Fragment.from(nodes), openStart, openEnd);
}

0 comments on commit 95dfa1e

Please sign in to comment.