|
|
@@ -38,7 +38,7 @@ export function downcastInsertTable() {
|
|
|
const tableWalker = new TableWalker( table );
|
|
|
|
|
|
for ( const tableWalkerValue of tableWalker ) {
|
|
|
- const { row } = tableWalkerValue;
|
|
|
+ const { row, cell } = tableWalkerValue;
|
|
|
|
|
|
const tableSection = getOrCreateTableSection( getSectionName( tableWalkerValue ), tableElement, conversionApi, tableSections );
|
|
|
const tableRow = table.getChild( row );
|
|
|
@@ -46,6 +46,9 @@ export function downcastInsertTable() {
|
|
|
// Check if row was converted
|
|
|
const trElement = getOrCreateTr( tableRow, row, tableSection, conversionApi );
|
|
|
|
|
|
+ // Consume table cell - it will be always consumed as we convert whole table at once.
|
|
|
+ conversionApi.consumable.consume( cell, 'insert' );
|
|
|
+
|
|
|
createViewTableCellElement( tableWalkerValue, ViewPosition.createAt( trElement, 'end' ), conversionApi );
|
|
|
}
|
|
|
|
|
|
@@ -83,6 +86,9 @@ export function downcastInsertRow() {
|
|
|
const tableSection = getOrCreateTableSection( getSectionName( tableWalkerValue ), tableElement, conversionApi );
|
|
|
const trElement = getOrCreateTr( tableRow, row, tableSection, conversionApi );
|
|
|
|
|
|
+ // Consume table cell - it will be always consumed as we convert whole row at once.
|
|
|
+ conversionApi.consumable.consume( tableWalkerValue.cell, 'insert' );
|
|
|
+
|
|
|
createViewTableCellElement( tableWalkerValue, ViewPosition.createAt( trElement, 'end' ), conversionApi );
|
|
|
}
|
|
|
}, { priority: 'normal' } );
|
|
|
@@ -238,9 +244,6 @@ function createViewTableCellElement( tableWalkerValue, insertPosition, conversio
|
|
|
|
|
|
const cellElementName = getCellElementName( tableWalkerValue );
|
|
|
|
|
|
- // Will always consume since we're converting <tableRow> element from a parent <table>.
|
|
|
- conversionApi.consumable.consume( tableCell, 'insert' );
|
|
|
-
|
|
|
const cellElement = conversionApi.writer.createContainerElement( cellElementName );
|
|
|
|
|
|
conversionApi.mapper.bindElements( tableCell, cellElement );
|