|
|
@@ -29,8 +29,9 @@ describe( 'Selection post-fixer', () => {
|
|
|
|
|
|
model.schema.register( 'table', {
|
|
|
allowWhere: '$block',
|
|
|
- isObject: true,
|
|
|
- isLimit: true
|
|
|
+ allowAttributes: [ 'headingRows', 'headingColumns' ],
|
|
|
+ isLimit: true,
|
|
|
+ isObject: true
|
|
|
} );
|
|
|
|
|
|
model.schema.register( 'tableRow', {
|
|
|
@@ -40,13 +41,16 @@ describe( 'Selection post-fixer', () => {
|
|
|
|
|
|
model.schema.register( 'tableCell', {
|
|
|
allowIn: 'tableRow',
|
|
|
- allowContentOf: '$block',
|
|
|
+ allowAttributes: [ 'colspan', 'rowspan' ],
|
|
|
isLimit: true
|
|
|
} );
|
|
|
|
|
|
+ model.schema.extend( '$block', { allowIn: 'tableCell' } );
|
|
|
+
|
|
|
model.schema.register( 'image', {
|
|
|
- allowIn: '$root',
|
|
|
- isObject: true
|
|
|
+ isObject: true,
|
|
|
+ isBlock: true,
|
|
|
+ allowWhere: '$block'
|
|
|
} );
|
|
|
|
|
|
model.schema.register( 'caption', {
|
|
|
@@ -100,7 +104,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>[]foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -118,7 +125,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>f[oo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -136,7 +146,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>b]ar</paragraph>'
|
|
|
);
|
|
|
@@ -154,7 +167,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>f[oo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -164,15 +180,18 @@ describe( 'Selection post-fixer', () => {
|
|
|
// <paragraph>foo</paragraph><table><tableRow><tableCell>a[aa</tableCell><tableCell>b]bb</tableCell>
|
|
|
model.change( writer => {
|
|
|
writer.setSelection( ModelRange.createFromParentsAndOffsets(
|
|
|
- modelRoot.getChild( 1 ).getChild( 0 ).getChild( 0 ), 1,
|
|
|
- modelRoot.getChild( 1 ).getChild( 0 ).getChild( 1 ), 2
|
|
|
+ modelRoot.getNodeByPath( [ 1, 0, 0, 0 ] ), 1,
|
|
|
+ modelRoot.getNodeByPath( [ 1, 0, 1, 0 ] ), 2
|
|
|
) );
|
|
|
} );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -182,11 +201,17 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'[]' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>xxx</tableCell><tableCell>yyy</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>xxx</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>yyy</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -194,10 +219,16 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>xxx</tableCell><tableCell>yyy</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>xxx</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>yyy</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -210,7 +241,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '[<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>]' +
|
|
|
+ '[<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>]' +
|
|
|
'</table>' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -218,7 +252,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -228,9 +265,18 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '[<tableRow><tableCell>1</tableCell><tableCell>2</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>3</tableCell><tableCell>4</tableCell>]</tableRow>' +
|
|
|
- '<tableRow><tableCell>5</tableCell><tableCell>6</tableCell></tableRow>' +
|
|
|
+ '[<tableRow>' +
|
|
|
+ '<tableCell><paragraph>1</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>2</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>3</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>4</paragraph></tableCell>]' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>5</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>6</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -238,9 +284,15 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>1</tableCell><tableCell>2</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>3</tableCell><tableCell>4</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>5</tableCell><tableCell>6</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>1</paragraph></tableCell><tableCell><paragraph>2</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>3</paragraph></tableCell><tableCell><paragraph>4</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>5</paragraph></tableCell><tableCell><paragraph>6</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>baz</paragraph>'
|
|
|
);
|
|
|
@@ -272,11 +324,14 @@ describe( 'Selection post-fixer', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- it( 'should not fix #1', () => {
|
|
|
+ it( 'should not fix #1 (selection after a table)', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>b[ar</paragraph>' +
|
|
|
'<paragraph>ba]z</paragraph>'
|
|
|
@@ -285,7 +340,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>b[ar</paragraph>' +
|
|
|
'<paragraph>ba]z</paragraph>'
|
|
|
@@ -304,7 +362,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>f[oo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>]' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -323,7 +384,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>f[oo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>ba]r</paragraph>'
|
|
|
);
|
|
|
@@ -333,10 +397,22 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>[aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow>]<tableCell>[aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow>]<tableCell>[aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow>]<tableCell>[aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>[aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>]' +
|
|
|
+ '<tableCell><paragraph>[aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>]' +
|
|
|
+ '<tableCell><paragraph>[aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>]' +
|
|
|
+ '<tableCell><paragraph>[aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>b]az</paragraph>'
|
|
|
);
|
|
|
@@ -344,16 +420,28 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'[<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>b]az</paragraph>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- it( 'should fix multiple ranges #4', () => {
|
|
|
+ it( 'should not fix multiple ranges #1 - not overlapping ranges', () => {
|
|
|
model.change( writer => {
|
|
|
const ranges = [
|
|
|
new ModelRange( new ModelPosition( modelRoot, [ 0, 1 ] ), new ModelPosition( modelRoot, [ 1, 0 ] ) ),
|
|
|
@@ -367,9 +455,28 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>f[oo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
- '<paragraph>bar]</paragraph>'
|
|
|
+ '<paragraph>b]a[r]</paragraph>'
|
|
|
+ );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should allow selection on block - limit element', () => {
|
|
|
+ model.schema.extend( '$block', { allowIn: 'tableCell' } );
|
|
|
+
|
|
|
+ setModelData( model,
|
|
|
+ '<table>' +
|
|
|
+ '<tableRow><tableCell>[<paragraph>aaa</paragraph>]</tableCell></tableRow>' +
|
|
|
+ '</table>'
|
|
|
+ );
|
|
|
+
|
|
|
+ expect( getModelData( model ) ).to.equal(
|
|
|
+ '<table>' +
|
|
|
+ '<tableRow><tableCell><paragraph>[aaa]</paragraph></tableCell></tableRow>' +
|
|
|
+ '</table>'
|
|
|
);
|
|
|
} );
|
|
|
} );
|
|
|
@@ -677,7 +784,7 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal( '<paragraph>foob[a]r</paragraph>' );
|
|
|
} );
|
|
|
|
|
|
- it( 'should not fix #2', () => {
|
|
|
+ it( 'should not fix #2 (inline widget selected)', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>[<inlineWidget></inlineWidget>]</paragraph>'
|
|
|
);
|
|
|
@@ -687,7 +794,7 @@ describe( 'Selection post-fixer', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- it( 'should not fix #3', () => {
|
|
|
+ it( 'should not fix #3 (text around inline widget)', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>fo[o<inlineWidget></inlineWidget>b]ar</paragraph>'
|
|
|
);
|
|
|
@@ -703,7 +810,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
setModelData( model,
|
|
|
'<paragraph>[]foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -720,7 +830,10 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo[]</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
@@ -739,13 +852,16 @@ describe( 'Selection post-fixer', () => {
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
'<paragraph>foo</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>[]aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>[]aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- it( 'should fix multiple ranges #1', () => {
|
|
|
+ it( 'should not fix multiple ranges #1', () => {
|
|
|
// []<paragraph>foo</paragraph>[]<table>...
|
|
|
model.change( writer => {
|
|
|
writer.setSelection(
|
|
|
@@ -757,9 +873,12 @@ describe( 'Selection post-fixer', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal(
|
|
|
- '<paragraph>[foo]</paragraph>' +
|
|
|
+ '<paragraph>[]foo[]</paragraph>' +
|
|
|
'<table>' +
|
|
|
- '<tableRow><tableCell>aaa</tableCell><tableCell>bbb</tableCell></tableRow>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
'</table>' +
|
|
|
'<paragraph>bar</paragraph>'
|
|
|
);
|