|
|
@@ -147,6 +147,35 @@ describe( 'downcast converters', () => {
|
|
|
) );
|
|
|
} );
|
|
|
|
|
|
+ it( 'should create table with block content (attribute on paragraph)', () => {
|
|
|
+ editor.conversion.attributeToAttribute(
|
|
|
+ {
|
|
|
+ model: { key: 'alignment', values: [ 'right', 'center', 'justify' ] },
|
|
|
+ view: {
|
|
|
+ right: { key: 'style', value: { 'text-align': 'right' } },
|
|
|
+ center: { key: 'style', value: { 'text-align': 'center' } },
|
|
|
+ justify: { key: 'style', value: { 'text-align': 'justify' } }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ setModelData( model, modelTable( [
|
|
|
+ [ '<paragraph alignment="right">00</paragraph>' ]
|
|
|
+ ] ) );
|
|
|
+
|
|
|
+ expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
|
|
|
+ '<figure class="table">' +
|
|
|
+ '<table>' +
|
|
|
+ '<tbody>' +
|
|
|
+ '<tr>' +
|
|
|
+ '<td><p style="text-align:right">00</p></td>' +
|
|
|
+ '</tr>' +
|
|
|
+ '</tbody>' +
|
|
|
+ '</table>' +
|
|
|
+ '</figure>'
|
|
|
+ ) );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should be possible to overwrite', () => {
|
|
|
editor.conversion.elementToElement( { model: 'tableRow', view: 'tr', converterPriority: 'high' } );
|
|
|
editor.conversion.elementToElement( { model: 'tableCell', view: 'td', converterPriority: 'high' } );
|