Skip to content

Commit

Permalink
Added th element support for DomConverter.
Browse files Browse the repository at this point in the history
  • Loading branch information
niegowski committed Jul 10, 2020
1 parent a40350f commit 8ae767c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ckeditor5-engine/src/view/domconverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class DomConverter {
* @readonly
* @member {Array.<String>} module:engine/view/domconverter~DomConverter#blockElements
*/
this.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'dd', 'dt', 'figcaption', 'td' ];
this.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'dd', 'dt', 'figcaption', 'td', 'th' ];

/**
* Block {@link module:engine/view/filler filler} creator, which is used to create all block fillers during the
Expand Down
8 changes: 4 additions & 4 deletions packages/ckeditor5-table/tests/tableclipboard-paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,7 @@ describe( 'table clipboard', () => {
] ) );
} );

it( 'removes block fillers from empty cells', async () => {
it( 'removes block fillers from empty cells (both td and th)', async () => {
await createEditor();

setModelData( model, modelTable( [
Expand All @@ -3571,7 +3571,7 @@ describe( 'table clipboard', () => {
pasteTable( [
[ '&nbsp;', '&nbsp;' ],
[ '&nbsp;', '&nbsp;' ]
] );
], { headingRows: 1 } );

assertEqualMarkup( getModelData( model, { withoutSelection: true } ), modelTable( [
[ '', '', '02' ],
Expand All @@ -3592,13 +3592,13 @@ describe( 'table clipboard', () => {
tableSelection = editor.plugins.get( 'TableSelection' );
}

function pasteTable( tableData ) {
function pasteTable( tableData, attributes = {} ) {
const data = {
dataTransfer: createDataTransfer(),
preventDefault: sinon.spy(),
stopPropagation: sinon.spy()
};
data.dataTransfer.setData( 'text/html', viewTable( tableData ) );
data.dataTransfer.setData( 'text/html', viewTable( tableData, attributes ) );
viewDocument.fire( 'paste', data );

return data;
Expand Down

0 comments on commit 8ae767c

Please sign in to comment.