foobar
foobar
foobar
foo
x
x
foo
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foo
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foo
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foo
bar
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foo
bar
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar
' );
expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( {
- data: 'foobar
' );
expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( {
- data: 'foobar
' );
expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( {
- data: 'foobar
' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', // At this point, attribute should still be in the model, as we are testing downcast conversion. attributes: { 1: { diff --git a/packages/ckeditor5-html-support/tests/integrations/customelement.js b/packages/ckeditor5-html-support/tests/integrations/customelement.js index ce3e83fe5f9..612bef59006 100644 --- a/packages/ckeditor5-html-support/tests/integrations/customelement.js +++ b/packages/ckeditor5-html-support/tests/integrations/customelement.js @@ -263,8 +263,8 @@ describe( 'CustomElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true, excludeAttributes } ) ).to.deep.equal( { data: 'bar"' + + ' htmlCustomElementAttributes="(1)"' + ' htmlElementName="custom-foo-element"> ', attributes: { 1: { @@ -286,8 +286,8 @@ describe( 'CustomElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true, excludeAttributes } ) ).to.deep.equal( { data: 'baz"' + + ' htmlCustomElementAttributes="(1)"' + ' htmlElementName="custom-foo-element"> ', attributes: { 1: { @@ -311,8 +311,8 @@ describe( 'CustomElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true, excludeAttributes } ) ).to.deep.equal( { data: 'baz"' + + ' htmlCustomElementAttributes="(1)"' + ' htmlElementName="custom-foo-element"> ', attributes: { 1: { @@ -337,8 +337,8 @@ describe( 'CustomElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true, excludeAttributes } ) ).to.deep.equal( { data: 'bar"' + + ' htmlCustomElementAttributes="(1)"' + ' htmlElementName="custom-foo-element"> ', attributes: { 1: { @@ -358,8 +358,8 @@ describe( 'CustomElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true, excludeAttributes } ) ).to.deep.equal( { data: 'bar"' + + ' htmlCustomElementAttributes="(1)"' + ' htmlElementName="custom-foo-element"> ', attributes: { 1: { diff --git a/packages/ckeditor5-html-support/tests/integrations/documentlist.js b/packages/ckeditor5-html-support/tests/integrations/documentlist.js index bc1d0808123..3378ec6773b 100644 --- a/packages/ckeditor5-html-support/tests/integrations/documentlist.js +++ b/packages/ckeditor5-html-support/tests/integrations/documentlist.js @@ -341,7 +341,7 @@ describe( 'DocumentListElementSupport', () => { '' + 'Foo' + ' ' + - 'Bar', + 'Bar', attributes: { 1: { attributes: { 'data-bar': 'A' } diff --git a/packages/ckeditor5-html-support/tests/integrations/dualcontent.js b/packages/ckeditor5-html-support/tests/integrations/dualcontent.js index e88efedf98d..7d4ed821fd3 100644 --- a/packages/ckeditor5-html-support/tests/integrations/dualcontent.js +++ b/packages/ckeditor5-html-support/tests/integrations/dualcontent.js @@ -158,8 +158,8 @@ describe( 'DualContentModelElementSupport', () => { editor.setData( 'foobar
foobar' ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: '' + - ' foobar foobar ', + data: '' + + ' foobar foobar ', attributes: { 1: { attributes: { 'data-foo': '' } diff --git a/packages/ckeditor5-html-support/tests/integrations/heading.js b/packages/ckeditor5-html-support/tests/integrations/heading.js index ad837d07820..13b12d222e9 100644 --- a/packages/ckeditor5-html-support/tests/integrations/heading.js +++ b/packages/ckeditor5-html-support/tests/integrations/heading.js @@ -112,11 +112,11 @@ describe( 'HeadingElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'one ' + - 'two ' + - 'three ' + - 'four ' + - 'five ', + 'one ' + + 'two ' + + 'three ' + + 'four ' + + 'five ', attributes: { 1: { attributes: { @@ -159,7 +159,7 @@ describe( 'HeadingElementSupport', () => { editor.execute( 'enter' ); expect( getModelDataWithAttributes( model ) ).to.deep.equal( { - data: 'foobar [] ', + data: 'foobar [] ', attributes: { 1: { classes: [ @@ -180,7 +180,7 @@ describe( 'HeadingElementSupport', () => { editor.execute( 'enter' ); expect( getModelDataWithAttributes( model ) ).to.deep.equal( { - data: 'foo []bar ', + data: 'foo []bar ', attributes: { 1: { classes: [ @@ -212,7 +212,7 @@ describe( 'HeadingElementSupport', () => { }, root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { styles: { @@ -238,7 +238,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.addModelHtmlClass( 'h2', 'foo', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { classes: [ 'foo' ] @@ -263,7 +263,7 @@ describe( 'HeadingElementSupport', () => { }, root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { @@ -288,7 +288,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlStyles( 'h1', 'color', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { styles: { @@ -313,7 +313,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlClass( 'h2', 'bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { classes: [ 'foo' ] @@ -336,7 +336,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlAttributes( 'h5', 'data-bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { @@ -367,7 +367,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlAttributes( 'h1', 'data-bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { @@ -514,11 +514,11 @@ describe( 'HeadingElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'one ' + - 'two ' + - 'three ' + - 'four ' + - 'five ', + 'one ' + + 'two ' + + 'three ' + + 'four ' + + 'five ', attributes: { 1: { attributes: { @@ -561,7 +561,7 @@ describe( 'HeadingElementSupport', () => { editor.execute( 'enter' ); expect( getModelDataWithAttributes( model ) ).to.deep.equal( { - data: 'foo []bar ', + data: 'foo []bar ', attributes: { 1: { classes: [ @@ -587,7 +587,7 @@ describe( 'HeadingElementSupport', () => { editor.execute( 'enter' ); expect( getModelDataWithAttributes( model ) ).to.deep.equal( { - data: 'foo []bar ', + data: 'foo []bar ', attributes: { 1: { classes: [ @@ -613,13 +613,13 @@ describe( 'HeadingElementSupport', () => { it( 'adding new styles', () => { editor.setData( 'foobar
' ); - htmlSupport.setModelHtmlStyles( 'h2', { + htmlSupport.setModelHtmlStyles( 'h1', { 'background-color': 'blue', color: 'red' }, root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { styles: { @@ -645,7 +645,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.addModelHtmlClass( 'h2', 'foo', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { classes: [ 'foo' ] @@ -670,7 +670,7 @@ describe( 'HeadingElementSupport', () => { }, root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { @@ -692,10 +692,10 @@ describe( 'HeadingElementSupport', () => { it( 'removing some styles', () => { editor.setData( 'foobar
' ); - htmlSupport.removeModelHtmlStyles( 'h3', 'color', root.getChild( 0 ) ); + htmlSupport.removeModelHtmlStyles( 'h1', 'color', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { styles: { @@ -720,7 +720,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlClass( 'h2', 'bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { classes: [ 'foo' ] @@ -743,7 +743,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlAttributes( 'h3', 'data-bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { @@ -774,7 +774,7 @@ describe( 'HeadingElementSupport', () => { htmlSupport.removeModelHtmlAttributes( 'h1', 'data-bar', root.getChild( 0 ) ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: 'foobar ', + data: 'foobar ', attributes: { 1: { attributes: { diff --git a/packages/ckeditor5-html-support/tests/integrations/image.js b/packages/ckeditor5-html-support/tests/integrations/image.js index 340627d3490..ce351e07df4 100644 --- a/packages/ckeditor5-html-support/tests/integrations/image.js +++ b/packages/ckeditor5-html-support/tests/integrations/image.js @@ -62,16 +62,16 @@ describe( 'ImageElementSupport', () => { editor.setData( expectedHtml ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: '', + data: ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'figure' } }, 2: { attributes: { - 'data-figure': 'figure' + 'data-image': 'image' } } } @@ -94,7 +94,7 @@ describe( 'ImageElementSupport', () => { editor.setData( expectedHtml ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: ' ', + data: ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { classes: [ 'foobar' ] @@ -120,7 +120,7 @@ describe( 'ImageElementSupport', () => { editor.setData( expectedHtml ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: ' ', + data: ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { styles: { @@ -239,19 +239,19 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ' + - ' ' + - ' foobar ' + + '' + + ' ' + + ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'image' } }, 2: { attributes: { - 'data-figure': 'image' + 'data-image': 'image' } }, 3: { @@ -290,7 +290,7 @@ describe( 'ImageElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ).add( dispatcher => { @@ -389,7 +389,7 @@ describe( 'ImageElementSupport', () => { // } ); // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - // data: 'foobar ' + '', + // data: ' ', // attributes: { // 1: { // attributes: { @@ -496,18 +496,18 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ' + ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'figure' } }, 2: { attributes: { - 'data-figure': 'figure' + 'data-image': 'image' } }, 3: { @@ -538,7 +538,7 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { @@ -569,7 +569,7 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { @@ -704,21 +704,21 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - '' + - ' foobar ' + + '' + + ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'image' } }, 2: { attributes: { - 'data-figure': 'image' + 'data-image': 'image' } }, 3: { @@ -744,7 +744,7 @@ describe( 'ImageElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ).add( dispatcher => { @@ -793,16 +793,16 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'foobar ' + '' + - ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'figure' }, classes: [ 'foobar' @@ -813,7 +813,7 @@ describe( 'ImageElementSupport', () => { }, 2: { attributes: { - 'data-figure': 'figure' + 'data-image': 'image' }, classes: [ 'foobar' @@ -950,7 +950,7 @@ describe( 'ImageElementSupport', () => { // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { // data: - // '' + + ' ' + '<$text htmlA="(5)" linkHref="www.example.com/2">foobar$text>' + ' ' + '' + // ' ', // attributes: { @@ -1082,18 +1082,18 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + - ' A caption ' + + '' + + ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'figure' } }, 2: { attributes: { - 'data-figure': 'figure' + 'data-image': 'image' } }, 3: { @@ -1123,8 +1123,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'A caption ' + '' + - ' A caption ' + + '' + + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -1153,8 +1153,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'A caption ' + '' + - ' A caption ' + + '' + + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -1280,19 +1280,19 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'A caption ' + '' + - ' ' + - ' foobar ' + + '' + + ' ' + + ' ', attributes: { 1: { attributes: { - 'data-image': 'image' + 'data-figure': 'image' } }, 2: { attributes: { - 'data-figure': 'image' + 'data-image': 'image' } }, 3: { @@ -1313,7 +1313,7 @@ describe( 'ImageElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ).add( dispatcher => { @@ -1369,8 +1369,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'foobar ' + '' + - ' A caption ' + + '' + + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -1615,8 +1615,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'A caption ' + '' + - ' ' + + ' ' + + ' ', attributes: { 1: { @@ -1647,8 +1647,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - ' ' + + ' ' + + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -1673,8 +1673,8 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - ' ' + + ' ' + + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -1770,7 +1770,7 @@ describe( 'ImageElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ).add( dispatcher => { @@ -1876,8 +1876,8 @@ describe( 'ImageElementSupport', () => { // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { // data: - // '' + ' ' + - // ' ' + + // ' ' + + // ' ', // attributes: { // 1: { @@ -1939,7 +1939,7 @@ describe( 'ImageElementSupport', () => { // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { // data: - // '' + // ' ' + + // ' ' + // ' ', // attributes: { @@ -1985,8 +1985,9 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + // ' ' + - ' ' + + ' ' + + ' ', attributes: { 1: { @@ -2027,8 +2028,9 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + + ' ' + '' + - ' ' + + ' ' + + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -2058,8 +2060,9 @@ describe( 'ImageElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + + ' ' + '' + - ' ' + + ' ' + + ' ', attributes: range( 1, 4 ).reduce( ( attributes, index ) => { attributes[ index ] = { @@ -2159,7 +2162,7 @@ describe( 'ImageElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ).add( dispatcher => { @@ -2259,7 +2262,7 @@ describe( 'ImageElementSupport', () => { // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { // data: - // '' + + ' ' + '' + + // ' ' + // ' ', // attributes: { @@ -2342,7 +2345,7 @@ describe( 'ImageElementSupport', () => { // expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { // data: - // '' + // ' ' + + // ' ' + // ' ', // attributes: { @@ -2403,7 +2406,7 @@ describe( 'ImageElementSupport', () => { 'src', 'srcset', 'linkHref', - 'htmlAttributes', + 'htmlImgAttributes', 'htmlFigureAttributes', 'htmlLinkAttributes' ] ); @@ -2438,7 +2441,7 @@ describe( 'ImageElementSupport', () => { 'src', 'srcset', 'htmlA', - 'htmlAttributes' + 'htmlImgAttributes' ] ); expect( schema.getDefinition( 'imageBlock' ) ).to.be.undefined; @@ -2467,10 +2470,10 @@ describe( 'ImageElementSupport', () => { editor.setData( '' ); expect( schema.getDefinition( 'imageBlock' ).allowAttributes ).to.deep.equal( [ - 'htmlAttributes' + 'htmlImgAttributes' ] ); expect( schema.getDefinition( 'imageInline' ).allowAttributes ).to.deep.equal( [ - 'htmlAttributes' + 'htmlImgAttributes' ] ); } ); } ); diff --git a/packages/ckeditor5-html-support/tests/integrations/mediaembed.js b/packages/ckeditor5-html-support/tests/integrations/mediaembed.js index f06b8aa1ec9..de5c3677ab2 100644 --- a/packages/ckeditor5-html-support/tests/integrations/mediaembed.js +++ b/packages/ckeditor5-html-support/tests/integrations/mediaembed.js @@ -57,16 +57,17 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + // ' ', + ' ' + + ' ', attributes: { 1: { attributes: { - 'data-oembed': 'data-oembed-value' + 'data-figure': 'data-figure-value' } }, 2: { attributes: { - 'data-figure': 'data-figure-value' + 'data-oembed': 'data-oembed-value' } } } @@ -90,7 +91,7 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '', + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { classes: [ 'foobar' ] @@ -117,7 +118,7 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ', + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { styles: { @@ -233,7 +234,7 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ', + ' ', attributes: { 1: { attributes: { @@ -270,8 +271,8 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: ' ' + - ' ' + - ' foobar ' + + '' + + ' ', attributes: { 1: { @@ -338,7 +339,7 @@ describe( 'MediaEmbedElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlOembedAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ) @@ -471,7 +472,12 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'foobar ' + '', + ' ' + + ' ', attributes: { 1: { attributes: { @@ -504,7 +510,12 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '', + ' ' + + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { classes: [ 'foobar' ] @@ -531,7 +542,12 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '', + ' ' + + ' ', attributes: range( 1, 3 ).reduce( ( attributes, index ) => { attributes[ index ] = { styles: { @@ -647,7 +663,11 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '', + ' ' + + ' ', attributes: { 1: { attributes: { @@ -684,8 +704,8 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: '' + - ' ' + - ' foobar ' + + '' + + ' ', attributes: { 1: { @@ -734,7 +754,7 @@ describe( 'MediaEmbedElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlCustomOembedAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { editor.conversion.for( 'downcast' ) @@ -998,9 +1018,9 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - 'foobar ' + '' + + ' ' + ' ', attributes: { @@ -1009,12 +1029,12 @@ describe( 'MediaEmbedElementSupport', () => { 'data-figure': 'data-figure-value' } }, - 2: { + 2: '', + 3: { attributes: { 'data-oembed': 'data-oembed-value' } - }, - 3: '' + } } } ); @@ -1041,19 +1061,19 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + - ' ' + '' + + ' ' + ' ' + + ' ' + ' ', attributes: { 1: { classes: [ 'media', 'foobar' ] }, - 2: { + 2: '', + 3: { classes: [ 'foobar' ] - }, - 3: '' + } } } ); @@ -1077,19 +1097,19 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + - ' ' + '' + + ' ' + ' ' + + ' ' + ' ', attributes: { 1: { styles: { color: 'red' } }, - 2: { + 2: '', + 3: { styles: { color: 'red' } - }, - 3: '' + } } } ); @@ -1200,15 +1220,15 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + - ' ' + '' + + ' ' + ' ', + ' ', attributes: { - 1: { + 1: '', + 2: { attributes: { 'data-foo': 'foo', 'url': 'https://www.youtube.com/watch?v=ZVv7UMQPEWk' } - }, - 2: '' + } } } ); @@ -1235,13 +1255,13 @@ describe( 'MediaEmbedElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ' + + ' ' + ' ' + - '' + ' ' + '' + ' ' + - ' foobar ' + + '' + + ' ', attributes: { 1: { @@ -1277,20 +1297,20 @@ describe( 'MediaEmbedElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlOembedAttributes', 'htmlFigureAttributes' ].forEach( attributeName => { - editor.conversion.for( 'downcast' ) - .add( dispatcher => { - dispatcher.on( `attribute:${ attributeName }:htmlOembed`, ( evt, data, conversionApi ) => { - conversionApi.consumable.consume( data.item, evt.name ); - }, { priority: 'high' } ); - } ) - .add( dispatcher => { - dispatcher.on( `attribute:${ attributeName }:htmlFigure`, ( evt, data, conversionApi ) => { - conversionApi.consumable.consume( data.item, evt.name ); - }, { priority: 'high' } ); - } ); + editor.conversion.for( 'downcast' ).add( dispatcher => { + dispatcher.on( `attribute:${ attributeName }:htmlOembed`, ( evt, data, conversionApi ) => { + conversionApi.consumable.consume( data.item, evt.name ); + }, { priority: 'high' } ); + } ); + } ); + + editor.conversion.for( 'downcast' ).add( dispatcher => { + dispatcher.on( 'attribute:htmlFigureAttributes:htmlFigure', ( evt, data, conversionApi ) => { + conversionApi.consumable.consume( data.item, evt.name ); + }, { priority: 'high' } ); } ); dataFilter.allowElement( /^(figure|oembed)$/ ); diff --git a/packages/ckeditor5-html-support/tests/integrations/script.js b/packages/ckeditor5-html-support/tests/integrations/script.js index 70281ef6e6b..984f4fb2de5 100644 --- a/packages/ckeditor5-html-support/tests/integrations/script.js +++ b/packages/ckeditor5-html-support/tests/integrations/script.js @@ -59,15 +59,15 @@ describe( 'ScriptElementSupport', () => { editor.setData( `foobar ' + 'Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { + 1: CODE_CPP, + 2: { attributes: { nonce: 'qwerty', type: 'c++' } - }, - 2: CODE_CPP + } } } ); @@ -81,14 +81,14 @@ describe( 'ScriptElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { + 1: CODE_CPP, + 2: { attributes: { type: 'c++' } - }, - 2: CODE_CPP + } } } ); @@ -154,7 +154,7 @@ describe( 'ScriptElementSupport', () => { dataFilter.allowAttributes( { name: 'script', attributes: true } ); editor.conversion.for( 'downcast' ).add( dispatcher => { - dispatcher.on( 'attribute:htmlAttributes:htmlScript', ( evt, data, conversionApi ) => { + dispatcher.on( 'attribute:htmlScriptAttributes:htmlScript', ( evt, data, conversionApi ) => { conversionApi.consumable.consume( data.item, evt.name ); }, { priority: 'high' } ); } ); @@ -162,10 +162,10 @@ describe( 'ScriptElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { attributes: { nonce: 'qwerty' } }, - 2: CODE + 1: CODE, + 2: { attributes: { nonce: 'qwerty' } } } } ); @@ -184,10 +184,10 @@ describe( 'ScriptElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { attributes: { type: 'c++' } }, - 2: CODE_CPP + 1: CODE_CPP, + 2: { attributes: { type: 'c++' } } } } ); } ); diff --git a/packages/ckeditor5-html-support/tests/integrations/style.js b/packages/ckeditor5-html-support/tests/integrations/style.js index 7a727e07bf4..2de7a1d1f27 100644 --- a/packages/ckeditor5-html-support/tests/integrations/style.js +++ b/packages/ckeditor5-html-support/tests/integrations/style.js @@ -58,15 +58,15 @@ describe( 'StyleElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { + 1: STYLE, + 2: { attributes: { nonce: 'qwerty', type: 'c++' } - }, - 2: STYLE + } } } ); @@ -80,14 +80,14 @@ describe( 'StyleElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { + 1: STYLE, + 2: { attributes: { type: 'c++' } - }, - 2: STYLE + } } } ); @@ -153,7 +153,7 @@ describe( 'StyleElementSupport', () => { dataFilter.allowAttributes( { name: 'style', attributes: true } ); editor.conversion.for( 'downcast' ).add( dispatcher => { - dispatcher.on( 'attribute:htmlAttributes:htmlStyle', ( evt, data, conversionApi ) => { + dispatcher.on( 'attribute:htmlStyleAttributes:htmlStyle', ( evt, data, conversionApi ) => { conversionApi.consumable.consume( data.item, evt.name ); }, { priority: 'high' } ); } ); @@ -161,10 +161,10 @@ describe( 'StyleElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { attributes: { nonce: 'qwerty' } }, - 2: STYLE + 1: STYLE, + 2: { attributes: { nonce: 'qwerty' } } } } ); @@ -183,10 +183,10 @@ describe( 'StyleElementSupport', () => { editor.setData( ` Foo
` ); expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { - data: `Foo `, + data: ` Foo `, attributes: { - 1: { attributes: { type: 'text/css' } }, - 2: STYLE + 1: STYLE, + 2: { attributes: { type: 'text/css' } } } } ); } ); diff --git a/packages/ckeditor5-html-support/tests/integrations/table.js b/packages/ckeditor5-html-support/tests/integrations/table.js index a92e259a6a1..5bb9d654a61 100644 --- a/packages/ckeditor5-html-support/tests/integrations/table.js +++ b/packages/ckeditor5-html-support/tests/integrations/table.js @@ -84,38 +84,38 @@ describe( 'TableElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - ' ' + - '
' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1 ' + '' + + ' ' + ' ' + - '2 ' + '' + + ' ' + ' ' + '3 ' + '' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1.1 ' + '' + + ' ' + ' ' + - '1.2 ' + '' + + ' ' + ' ' + '1.3 ' + '' + - ' ' + + ' ' + + ' ' + @@ -123,12 +123,12 @@ describe( 'TableElementSupport', () => { attributes: { 1: { attributes: { - 'data-table': 'table' + 'data-figure': 'figure' } }, 2: { attributes: { - 'data-figure': 'figure' + 'data-table': 'table' } }, 3: { @@ -242,38 +242,38 @@ describe( 'TableElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - '2.1 ' + '' + + ' ' + ' ' + - '2.2 ' + '' + + ' ' + ' ' + '2.3 ' + '' + - '
' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1 ' + '' + + ' ' + ' ' + - '2 ' + '' + + ' ' + ' ' + '3 ' + '' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1.1 ' + '' + + ' ' + ' ' + - '1.2 ' + '' + + ' ' + ' ' + '1.3 ' + '' + - ' ' + + ' ' + + ' ' + @@ -324,38 +324,38 @@ describe( 'TableElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - '2.1 ' + '' + + ' ' + ' ' + - '2.2 ' + '' + + ' ' + ' ' + '2.3 ' + '' + - '
', attributes: { 1: { @@ -2003,37 +2003,37 @@ describe( 'TableElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1 ' + '' + + ' ' + ' ' + - '2 ' + '' + + ' ' + ' ' + '3 ' + '' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1.1 ' + '' + + ' ' + ' ' + - '1.2 ' + '' + + ' ' + ' ' + '1.3 ' + '' + - ' ' + - '' + + ' ' + '' + + ' ' + @@ -1015,7 +1015,7 @@ describe( 'TableElementSupport', () => { expect( getModelDataWithAttributes( model, { withoutSelection: true } ) ).to.deep.equal( { data: - '' + ' ' + - '2.1 ' + '' + + ' ' + ' ' + - '2.2 ' + '' + + ' ' + ' ' + '2.3 ' + '' + + '
', attributes: { 1: { @@ -1867,7 +1867,7 @@ describe( 'TableElementSupport', () => { '' + '
' + - '' + ' ' + '' + ' ' + '1.1 ' + @@ -1089,8 +1089,8 @@ describe( 'TableElementSupport', () => { '' + - ' foobar ' + + '' + + ' ', attributes: { 1: { @@ -1140,7 +1140,7 @@ describe( 'TableElementSupport', () => { it( 'should not consume attributes already consumed (downcast)', () => { [ - 'htmlAttributes', + 'htmlTableAttributes', 'htmlFigureAttributes', 'htmlTbodyAttributes', 'htmlTheadAttributes' @@ -1736,7 +1736,7 @@ describe( 'TableElementSupport', () => { 'foobar ' + '1.3 ' + '' + '' + - 'caption ' + + 'caption ' + '1.3 ' + 'caption ' + + 'caption ' + '' + - '
' + - ' ' + + ' ' + + '
' + + ' ' + - '' + ' ' + - '1 ' + '' + + ' ' + ' ' + - '2 ' + '' + + ' ' + ' ' + '3 ' + '' + - ' ' + + ' ' + + ' ' + - '' + ' ' + - '1.1 ' + '' + + ' ' + ' ' + - '1.2 ' + '' + + ' ' + ' ' + '1.3 ' + '' + - ' ' + + ' ' + + ' ' + diff --git a/packages/ckeditor5-style/tests/integrations/table.js b/packages/ckeditor5-style/tests/integrations/table.js index 971c0078fde..945d86a41c4 100644 --- a/packages/ckeditor5-style/tests/integrations/table.js +++ b/packages/ckeditor5-style/tests/integrations/table.js @@ -98,7 +98,7 @@ describe( 'TableStyleSupport', () => { command.execute( { styleName: 'Test table style' } ); expect( getData( model, { withoutSelection: true } ) ).to.equal( - '' + ' ' + - '2.1 ' + '' + + ' ' + ' ' + - '2.2 ' + '' + + ' ' + ' ' + '2.3 ' + '' + + '
' + '
' + ' ' + ' foo ' + @@ -333,7 +333,7 @@ describe( 'TableStyleSupport', () => { expect( getData( model, { withoutSelection: true } ) ).to.equal( '' + '
' + - ' ' + @@ -400,7 +400,7 @@ describe( 'TableStyleSupport', () => { expect( getData( model, { withoutSelection: true } ) ).to.equal( '' + + ' ' + ' ' + 'foo ' + '' + - '
' ); } ); @@ -516,7 +520,7 @@ describe( 'TableStyleSupport', () => { expect( getData( model, { withoutSelection: true } ) ).to.equal( '' + + ' ' + ' ' + - '' + ' ' + @@ -427,7 +427,7 @@ describe( 'TableStyleSupport', () => { expect( getData( model, { withoutSelection: true } ) ).to.equal( 'foo ' + '' + '
' ); } ); @@ -485,7 +485,11 @@ describe( 'TableStyleSupport', () => { '' + - ' ' + @@ -457,7 +457,7 @@ describe( 'TableStyleSupport', () => { '' + + ' ' + ' ' + 'foo ' + 'foo ' + '' + '' + - 'abc ' + + 'abc ' + 'foo ' + '' + 'abc ' + + '' + + 'abc ' + '' + '
' + - ' ' + diff --git a/packages/ckeditor5-style/tests/stylecommand.js b/packages/ckeditor5-style/tests/stylecommand.js index 00478ad270f..21ab5248951 100644 --- a/packages/ckeditor5-style/tests/stylecommand.js +++ b/packages/ckeditor5-style/tests/stylecommand.js @@ -187,9 +187,9 @@ describe( 'StyleCommand', () => { command.execute( { styleName: 'Red paragraph' } ); expect( getData( model ) ).to.equal( - '' + + ' ' + ' ' + 'header ' + '' + - ' [Foo ' + - ' Bar ' + ' Baz] ' + + ' [Foo ' + + ' Bar ' ); } ); @@ -260,7 +260,7 @@ describe( 'StyleCommand', () => { it( 'should not enable styles for blocks that disable GHS', () => { model.schema.addAttributeCheck( ( context, attributeName ) => { - if ( context.endsWith( 'paragraph' ) && attributeName == 'htmlAttributes' ) { + if ( context.endsWith( 'paragraph' ) && attributeName == 'htmlPAttributes' ) { return false; } } ); @@ -355,7 +355,7 @@ describe( 'StyleCommand', () => { setData( model, ' Baz] fo[]o ' ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'red' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlPAttributes', { classes: [ 'red' ] }, root.getChild( 0 ) ); } ); expect( command.value ).to.have.members( [ 'Red paragraph' ] ); @@ -368,7 +368,7 @@ describe( 'StyleCommand', () => { ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'big-heading' ] }, root.getChild( 1 ) ); + writer.setAttribute( 'htmlH2Attributes', { classes: [ 'big-heading' ] }, root.getChild( 1 ) ); } ); expect( command.value ).to.have.members( [ 'Big heading' ] ); @@ -381,8 +381,8 @@ describe( 'StyleCommand', () => { ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'red' ] }, root.getChild( 0 ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'red' ] }, root.getChild( 1 ) ); + writer.setAttribute( 'htmlPAttributes', { classes: [ 'red' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlH2Attributes', { classes: [ 'red' ] }, root.getChild( 1 ) ); } ); expect( command.value ).to.have.members( [ 'Red paragraph' ] ); @@ -404,7 +404,7 @@ describe( 'StyleCommand', () => { ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'side-quote' ] }, root.getChild( 1 ) ); + writer.setAttribute( 'htmlBlockquoteAttributes', { classes: [ 'side-quote' ] }, root.getChild( 1 ) ); } ); expect( command.value ).to.have.members( [ 'Side quote' ] ); @@ -414,7 +414,7 @@ describe( 'StyleCommand', () => { setData( model, 'foo[bar]baz ' ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'vibrant-code' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlPreAttributes', { classes: [ 'vibrant-code' ] }, root.getChild( 0 ) ); } ); expect( command.value ).to.have.members( [ 'Vibrant code block' ] ); @@ -434,9 +434,9 @@ describe( 'StyleCommand', () => { ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'side-quote' ] }, root.getChild( 0 ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'example' ] }, root.getNodeByPath( [ 0, 0 ] ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'red' ] }, root.getNodeByPath( [ 0, 0, 0, 0, 0 ] ) ); + writer.setAttribute( 'htmlBlockquoteAttributes', { classes: [ 'side-quote' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlTableAttributes', { classes: [ 'example' ] }, root.getNodeByPath( [ 0, 0 ] ) ); + writer.setAttribute( 'htmlPAttributes', { classes: [ 'red' ] }, root.getNodeByPath( [ 0, 0, 0, 0, 0 ] ) ); } ); expect( command.value ).to.have.members( [ 'Red paragraph', 'Table style' ] ); @@ -456,9 +456,9 @@ describe( 'StyleCommand', () => { ); model.change( writer => { - writer.setAttribute( 'htmlAttributes', { classes: [ 'side-quote' ] }, root.getChild( 0 ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'example' ] }, root.getNodeByPath( [ 0, 0 ] ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'red' ] }, root.getNodeByPath( [ 0, 0, 0, 0, 0 ] ) ); + writer.setAttribute( 'htmlBlockquoteAttributes', { classes: [ 'side-quote' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlTableAttributes', { classes: [ 'example' ] }, root.getNodeByPath( [ 0, 0 ] ) ); + writer.setAttribute( 'htmlPAttributes', { classes: [ 'red' ] }, root.getNodeByPath( [ 0, 0, 0, 0, 0 ] ) ); } ); expect( command.value ).to.have.members( [ 'Table style' ] ); @@ -477,7 +477,7 @@ describe( 'StyleCommand', () => { model.change( writer => { writer.setAttribute( 'htmlFigureAttributes', { classes: [ 'fancy-figure' ] }, root.getChild( 0 ) ); - writer.setAttribute( 'htmlAttributes', { classes: [ 'example' ] }, root.getChild( 0 ) ); + writer.setAttribute( 'htmlTableAttributes', { classes: [ 'example' ] }, root.getChild( 0 ) ); } ); expect( command.value ).to.have.members( [ @@ -594,7 +594,7 @@ describe( 'StyleCommand', () => { expect( getData( model, { withoutSelection: true } ) ).to.equal( '' + ' ' @@ -778,7 +778,7 @@ describe( 'StyleCommand', () => { command.execute( { styleName: 'Big heading' } ); expect( getData( model ) ).to.equal( - 'foo[]bar ' + 'foo[]bar ' ); } ); @@ -789,7 +789,7 @@ describe( 'StyleCommand', () => { command.execute( { styleName: 'Red heading' } ); expect( getData( model ) ).to.equal( - 'foo[]bar ' + 'foo[]bar ' ); } ); @@ -803,9 +803,9 @@ describe( 'StyleCommand', () => { command.execute( { styleName: 'Red heading' } ); expect( getData( model ) ).to.equal( - 'fo[o ' + + 'fo[o ' + 'bar ' + - 'ba]z ' + 'ba]z ' ); } ); @@ -831,7 +831,7 @@ describe( 'StyleCommand', () => { '' + '
' + ' ' + - ' ' + @@ -864,7 +864,7 @@ describe( 'StyleCommand', () => { '' + + '' + '' + 'fo[]o ' + '' + '
' + ' ' + - ' ' + + '
' + '
' + ' ' + ' fo[]o ' + @@ -949,15 +949,15 @@ describe( 'StyleCommand', () => { it( 'should force adding style if the command was called with `forceValue=true`', () => { setData( model, 'foo ' + - 'b[ar ' + + 'b[ar ' + 'ba]z ' ); command.execute( { styleName: 'Red heading', forceValue: true } ); expect( getData( model ) ).to.equal( 'foo ' + - 'b[ar ' + - 'ba]z ' + 'b[ar ' + + 'ba]z ' ); } ); @@ -979,7 +979,7 @@ describe( 'StyleCommand', () => { it( 'should force removing style if the command was called with `forceValue=false`', () => { setData( model, 'f[oo ' + - 'ba]r ' + + 'ba]r ' + 'baz ' ); command.execute( { styleName: 'Red heading', forceValue: false } );