|
@@ -21,7 +21,7 @@ import ModelText from '@ckeditor/ckeditor5-engine/src/model/text';
|
|
|
import ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';
|
|
import ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';
|
|
|
|
|
|
|
|
describe( 'Paragraph feature', () => {
|
|
describe( 'Paragraph feature', () => {
|
|
|
- let editor, doc, root;
|
|
|
|
|
|
|
+ let editor, doc, root, batch;
|
|
|
|
|
|
|
|
beforeEach( () => {
|
|
beforeEach( () => {
|
|
|
return VirtualTestEditor
|
|
return VirtualTestEditor
|
|
@@ -30,6 +30,7 @@ describe( 'Paragraph feature', () => {
|
|
|
editor = newEditor;
|
|
editor = newEditor;
|
|
|
doc = editor.document;
|
|
doc = editor.document;
|
|
|
root = doc.getRoot();
|
|
root = doc.getRoot();
|
|
|
|
|
+ batch = doc.batch();
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -91,7 +92,7 @@ describe( 'Paragraph feature', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should not autoparagraph text (in clipboard holder)', () => {
|
|
it( 'should not autoparagraph text (in clipboard holder)', () => {
|
|
|
- const modelFragment = editor.data.parse( 'foo', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( 'foo' );
|
|
.to.equal( 'foo' );
|
|
@@ -100,7 +101,7 @@ describe( 'Paragraph feature', () => {
|
|
|
it( 'should not autoparagraph text (in a context which does not allow paragraphs', () => {
|
|
it( 'should not autoparagraph text (in a context which does not allow paragraphs', () => {
|
|
|
doc.schema.registerItem( 'specialRoot' );
|
|
doc.schema.registerItem( 'specialRoot' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( 'foo', 'specialRoot' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo', batch, 'specialRoot' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '' );
|
|
.to.equal( '' );
|
|
@@ -110,21 +111,21 @@ describe( 'Paragraph feature', () => {
|
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<h1>foo</h1>bar<p>bom</p>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1>foo</h1>bar<p>bom</p>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<heading1>foo</heading1><paragraph>bar</paragraph><paragraph>bom</paragraph>' );
|
|
.to.equal( '<heading1>foo</heading1><paragraph>bar</paragraph><paragraph>bom</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should autoparagraph 3 inline nodes into one paragraph', () => {
|
|
it( 'should autoparagraph 3 inline nodes into one paragraph', () => {
|
|
|
- const modelFragment = editor.data.parse( 'foo<b>bar</b>bom' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo<b>bar</b>bom', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>foobarbom</paragraph>' );
|
|
.to.equal( '<paragraph>foobarbom</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should not autoparagraph 3 inline nodes (in clipboardHolder)', () => {
|
|
it( 'should not autoparagraph 3 inline nodes (in clipboardHolder)', () => {
|
|
|
- const modelFragment = editor.data.parse( 'foo<b>bar</b>bom', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo<b>bar</b>bom', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( 'foobarbom' );
|
|
.to.equal( 'foobarbom' );
|
|
@@ -137,7 +138,7 @@ describe( 'Paragraph feature', () => {
|
|
|
|
|
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<div>foo</div><div>bom<p>bim</p></div>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<div>foo</div><div>bom<p>bim</p></div>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal(
|
|
.to.equal(
|
|
@@ -150,7 +151,7 @@ describe( 'Paragraph feature', () => {
|
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<div><h1>foo</h1>bar</div>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<div><h1>foo</h1>bar</div>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<heading1>foo</heading1><paragraph>bar</paragraph>' );
|
|
.to.equal( '<heading1>foo</heading1><paragraph>bar</paragraph>' );
|
|
@@ -160,7 +161,7 @@ describe( 'Paragraph feature', () => {
|
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
doc.schema.registerItem( 'heading1', '$block' );
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'h1' ).toElement( 'heading1' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<h1><b>foo</b>bar</h1>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1><b>foo</b>bar</h1>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<heading1>foobar</heading1>' );
|
|
.to.equal( '<heading1>foobar</heading1>' );
|
|
@@ -169,13 +170,13 @@ describe( 'Paragraph feature', () => {
|
|
|
it( 'should not fail when text is not allowed in paragraph', () => {
|
|
it( 'should not fail when text is not allowed in paragraph', () => {
|
|
|
doc.schema.disallow( { name: '$text', inside: [ '$root', 'paragraph' ] } );
|
|
doc.schema.disallow( { name: '$text', inside: [ '$root', 'paragraph' ] } );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( 'foo' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '' );
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'creates normalized model', () => {
|
|
it( 'creates normalized model', () => {
|
|
|
- const modelFragment = editor.data.parse( 'foo<b>bar</b>bom' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo<b>bar</b>bom', batch );
|
|
|
|
|
|
|
|
expect( modelFragment ).to.be.instanceof( ModelDocumentFragment );
|
|
expect( modelFragment ).to.be.instanceof( ModelDocumentFragment );
|
|
|
expect( modelFragment.getChild( 0 ).childCount ).to.equal( 1 );
|
|
expect( modelFragment.getChild( 0 ).childCount ).to.equal( 1 );
|
|
@@ -188,7 +189,7 @@ describe( 'Paragraph feature', () => {
|
|
|
consumable.consume( data.input, { name: true } );
|
|
consumable.consume( data.input, { name: true } );
|
|
|
}, { priority: 'highest' } );
|
|
}, { priority: 'highest' } );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<ul><li></li></ul>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li></li></ul>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '' );
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '' );
|
|
|
} );
|
|
} );
|
|
@@ -202,7 +203,7 @@ describe( 'Paragraph feature', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'inside document fragment', () => {
|
|
it( 'inside document fragment', () => {
|
|
|
- const modelFragment = editor.data.parse( 'foo<b>bar</b>bom' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( 'foo<b>bar</b>bom', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '<paragraph>foo<$text bold="true">bar</$text>bom</paragraph>' );
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '<paragraph>foo<$text bold="true">bar</$text>bom</paragraph>' );
|
|
|
} );
|
|
} );
|
|
@@ -218,14 +219,14 @@ describe( 'Paragraph feature', () => {
|
|
|
|
|
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'blockquote' ).toElement( 'blockquote' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'blockquote' ).toElement( 'blockquote' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<blockquote>foo<b>bar</b>bom</blockquote>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<blockquote>foo<b>bar</b>bom</blockquote>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<blockquote><paragraph>foo<$text bold="true">bar</$text>bom</paragraph></blockquote>' );
|
|
.to.equal( '<blockquote><paragraph>foo<$text bold="true">bar</$text>bom</paragraph></blockquote>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'inside paragraph-like element', () => {
|
|
it( 'inside paragraph-like element', () => {
|
|
|
- const modelFragment = editor.data.parse( '<h1>foo</h1><h2><b>bar</b>bom</h2>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1>foo</h1><h2><b>bar</b>bom</h2>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph><$text bold="true">bar</$text>bom</paragraph>' );
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph><$text bold="true">bar</$text>bom</paragraph>' );
|
|
@@ -235,14 +236,14 @@ describe( 'Paragraph feature', () => {
|
|
|
|
|
|
|
|
describe( 'generic block converter (paragraph-like element handling)', () => {
|
|
describe( 'generic block converter (paragraph-like element handling)', () => {
|
|
|
it( 'should convert h1+h2', () => {
|
|
it( 'should convert h1+h2', () => {
|
|
|
- const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert h1+h2 (in clipboard holder)', () => {
|
|
it( 'should convert h1+h2 (in clipboard holder)', () => {
|
|
|
- const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2>', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2>', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
|
|
.to.equal( '<paragraph>foo</paragraph><paragraph>bar</paragraph>' );
|
|
@@ -256,28 +257,28 @@ describe( 'Paragraph feature', () => {
|
|
|
|
|
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2><div>bom</div>', 'specialRoot' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1>foo</h1><h2>bar</h2><div>bom</div>', batch, 'specialRoot' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<div>bom</div>' );
|
|
.to.equal( '<div>bom</div>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert ul,ol>li', () => {
|
|
it( 'should convert ul,ol>li', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li>a</li><li>b</li></ul><ol><li>c</li></ol>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li>a</li><li>b</li></ul><ol><li>c</li></ol>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert ul,ol>li (in clipboard holder)', () => {
|
|
it( 'should convert ul,ol>li (in clipboard holder)', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li>a</li><li>b</li></ul><ol><li>c</li></ol>', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li>a</li><li>b</li></ul><ol><li>c</li></ol>', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert ul>li>ul>li+li', () => {
|
|
it( 'should convert ul>li>ul>li+li', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li>a<ul><li>b</li><li>c</li></ul></li></ul>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li>a<ul><li>b</li><li>c</li></ul></li></ul>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
@@ -286,14 +287,14 @@ describe( 'Paragraph feature', () => {
|
|
|
// "b" is not autoparagraphed because clipboard holder allows text nodes.
|
|
// "b" is not autoparagraphed because clipboard holder allows text nodes.
|
|
|
// There's a similar integrational test what's going to happen when pasting in paragraph-integration.js.
|
|
// There's a similar integrational test what's going to happen when pasting in paragraph-integration.js.
|
|
|
it( 'should convert ul>li>ul>li+li (in clipboard holder)', () => {
|
|
it( 'should convert ul>li>ul>li+li (in clipboard holder)', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li>a<ul><li>b</li><li>c</li></ul></li></ul>', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li>a<ul><li>b</li><li>c</li></ul></li></ul>', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert ul>li>p,text', () => {
|
|
it( 'should convert ul>li>p,text', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li><p>a</p>b</li></ul>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li><p>a</p>b</li></ul>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph>' );
|
|
@@ -302,14 +303,17 @@ describe( 'Paragraph feature', () => {
|
|
|
// "b" is not autoparagraphed because clipboard holder allows text nodes.
|
|
// "b" is not autoparagraphed because clipboard holder allows text nodes.
|
|
|
// There's a similar integrational test what's going to happen when pasting in paragraph-integration.js.
|
|
// There's a similar integrational test what's going to happen when pasting in paragraph-integration.js.
|
|
|
it( 'should convert ul>li>p,text (in clipboard holder)', () => {
|
|
it( 'should convert ul>li>p,text (in clipboard holder)', () => {
|
|
|
- const modelFragment = editor.data.parse( '<ul><li><p>a</p>b</li></ul>', '$clipboardHolder' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<ul><li><p>a</p>b</li></ul>', batch, '$clipboardHolder' );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert td', () => {
|
|
it( 'should convert td', () => {
|
|
|
- const modelFragment = editor.data.parse( '<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse(
|
|
|
|
|
+ '<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>',
|
|
|
|
|
+ batch
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph><paragraph>d</paragraph>' );
|
|
.to.equal( '<paragraph>a</paragraph><paragraph>b</paragraph><paragraph>c</paragraph><paragraph>d</paragraph>' );
|
|
@@ -318,6 +322,7 @@ describe( 'Paragraph feature', () => {
|
|
|
it( 'should convert td (in clipboardHolder)', () => {
|
|
it( 'should convert td (in clipboardHolder)', () => {
|
|
|
const modelFragment = editor.data.parse(
|
|
const modelFragment = editor.data.parse(
|
|
|
'<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>',
|
|
'<table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>',
|
|
|
|
|
+ batch,
|
|
|
'$clipboardHolder'
|
|
'$clipboardHolder'
|
|
|
);
|
|
);
|
|
|
|
|
|
|
@@ -332,7 +337,7 @@ describe( 'Paragraph feature', () => {
|
|
|
|
|
|
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
buildViewConverter().for( editor.data.viewToModel ).fromElement( 'div' ).toElement( 'div' );
|
|
|
|
|
|
|
|
- const modelFragment = editor.data.parse( '<div><ul><li>foo</li><li>bar</li></ul></div><div>bom<p>bim</p></div>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<div><ul><li>foo</li><li>bar</li></ul></div><div>bom<p>bim</p></div>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal(
|
|
.to.equal(
|
|
@@ -342,7 +347,7 @@ describe( 'Paragraph feature', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert li inside disallowed container', () => {
|
|
it( 'should convert li inside disallowed container', () => {
|
|
|
- const modelFragment = editor.data.parse( '<div><ul><li>foo</li><li>bar</li></ul></div><div>bom<p>bim</p></div>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<div><ul><li>foo</li><li>bar</li></ul></div><div>bom<p>bim</p></div>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) )
|
|
expect( stringifyModel( modelFragment ) )
|
|
|
.to.equal(
|
|
.to.equal(
|
|
@@ -352,7 +357,7 @@ describe( 'Paragraph feature', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'creates normalized model', () => {
|
|
it( 'creates normalized model', () => {
|
|
|
- const modelFragment = editor.data.parse( '<h1><span>foo</span><span>bar</span>' );
|
|
|
|
|
|
|
+ const modelFragment = editor.data.parse( '<h1><span>foo</span><span>bar</span>', batch );
|
|
|
|
|
|
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '<paragraph>foobar</paragraph>' );
|
|
expect( stringifyModel( modelFragment ) ).to.equal( '<paragraph>foobar</paragraph>' );
|
|
|
|
|
|