Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 098c1af

Browse files
committed
[IMP] Table: use configured separator instead of LineBreakNode
1 parent b2666af commit 098c1af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/plugin-table/src/Table.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ export class Table<T extends JWPluginConfig = JWPluginConfig> extends JWPlugin<T
280280
// Only merge the cells if they would not imply to merge
281281
// unrelated cells, ie. the selected cells form a rectangle.
282282
const managerCell = cells.shift();
283+
const Separator = this.editor.configuration.defaults.Separator;
283284
for (const cell of cells) {
285+
if (managerCell.hasChildren()) {
286+
managerCell.append(new Separator());
287+
}
284288
cell.mergeWith(managerCell);
285289
}
286290
}

packages/plugin-table/src/TableCellNode.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { VNode } from '../../core/src/VNodes/VNode';
22
import { TableNode } from './TableNode';
33
import { TableRowNode } from './TableRowNode';
4-
import { LineBreakNode } from '../../plugin-linebreak/src/LineBreakNode'; // TODO: remove dependency
54
import { ContainerNode } from '../../core/src/VNodes/ContainerNode';
65

76
export interface TableCellAttributes extends Record<string, string | Record<string, string>> {
@@ -164,9 +163,6 @@ export class TableCellNode extends ContainerNode {
164163
cell.header = this.header;
165164

166165
// Move the children to the manager.
167-
if (cell.hasChildren()) {
168-
this.append(new LineBreakNode());
169-
}
170166
this.append(...cell.childVNodes);
171167

172168
// Hand the managed cells over to the manager.

0 commit comments

Comments
 (0)