diff --git a/src/model/schema.js b/src/model/schema.js index b010b0d81..150eff68b 100644 --- a/src/model/schema.js +++ b/src/model/schema.js @@ -1047,7 +1047,7 @@ mix( Schema, ObservableMixin ); * * schema.register( 'listItem', { * inheritAllFrom: '$block', - * allowAttributes: [ 'type', 'indent' ] + * allowAttributes: [ 'listType', 'listIndent' ] * } ); * * Which translates to: @@ -1057,7 +1057,7 @@ mix( Schema, ObservableMixin ); * allowContentOf: '$block', * allowAttributesOf: '$block', * inheritTypesFrom: '$block', - * allowAttributes: [ 'type', 'indent' ] + * allowAttributes: [ 'listType', 'listIndent' ] * } ); * * # Tips diff --git a/tests/dev-utils/enableenginedebug.js b/tests/dev-utils/enableenginedebug.js index 425ed3c40..ec415c7b7 100644 --- a/tests/dev-utils/enableenginedebug.js +++ b/tests/dev-utils/enableenginedebug.js @@ -634,7 +634,7 @@ describe( 'debug tools', () => { new ModelElement( 'paragraph', { foo: 'bar' }, [ new ModelText( 'This is ' ), new ModelText( 'bold', { bold: true } ), new ModelText( '.' ) ] ), - new ModelElement( 'listItem', { type: 'numbered', indent: 0 }, new ModelText( 'One.' ) ), + new ModelElement( 'listItem', { listType: 'numbered', listIndent: 0 }, new ModelText( 'One.' ) ), ] ); const modelRootTree = modelRoot.printTree(); @@ -646,7 +646,7 @@ describe( 'debug tools', () => { '\n\t\t<$text bold=true>bold' + '\n\t\t.' + '\n\t' + - '\n\t' + + '\n\t' + '\n\t\tOne.' + '\n\t' + '\n' diff --git a/tests/model/schema.js b/tests/model/schema.js index 17889fc40..8adc8ea16 100644 --- a/tests/model/schema.js +++ b/tests/model/schema.js @@ -2270,7 +2270,7 @@ describe( 'Schema', () => { () => { schema.register( 'listItem', { inheritAllFrom: '$block', - allowAttributes: [ 'indent', 'type' ] + allowAttributes: [ 'listIndent', 'listType' ] } ); }, () => { @@ -2351,11 +2351,11 @@ describe( 'Schema', () => { root1 = new Element( '$root', null, [ new Element( 'paragraph', null, 'foo' ), new Element( 'paragraph', { alignment: 'right' }, 'bar' ), - new Element( 'listItem', { type: 'x', indent: 0 }, 'foo' ), + new Element( 'listItem', { listType: 'x', listIndent: 0 }, 'foo' ), new Element( 'heading1', null, 'foo' ), new Element( 'blockQuote', null, [ new Element( 'paragraph', null, 'foo' ), - new Element( 'listItem', { type: 'x', indent: 0 }, 'foo' ), + new Element( 'listItem', { listType: 'x', listIndent: 0 }, 'foo' ), new Element( 'image', null, [ new Element( 'caption', null, 'foo' ) ] ) @@ -2522,11 +2522,11 @@ describe( 'Schema', () => { } ); it( 'accepts attribute $root>listItem[indent]', () => { - expect( schema.checkAttribute( r1lI, 'indent' ) ).to.be.true; + expect( schema.checkAttribute( r1lI, 'listIndent' ) ).to.be.true; } ); it( 'accepts attribute $root>listItem[type]', () => { - expect( schema.checkAttribute( r1lI, 'type' ) ).to.be.true; + expect( schema.checkAttribute( r1lI, 'listType' ) ).to.be.true; } ); it( 'accepts attribute $root>image[src]', () => { @@ -2542,11 +2542,11 @@ describe( 'Schema', () => { } ); it( 'rejects attribute $root[indent]', () => { - expect( schema.checkAttribute( root1, 'indent' ) ).to.be.false; + expect( schema.checkAttribute( root1, 'listIndent' ) ).to.be.false; } ); it( 'rejects attribute $root>paragraph[indent]', () => { - expect( schema.checkAttribute( r1p1, 'indent' ) ).to.be.false; + expect( schema.checkAttribute( r1p1, 'listIndent' ) ).to.be.false; } ); it( 'accepts attribute $root>heading1>$text[bold]', () => { @@ -2558,7 +2558,7 @@ describe( 'Schema', () => { } ); it( 'rejects attribute $root>blockQuote[indent]', () => { - expect( schema.checkAttribute( r1bQ, 'indent' ) ).to.be.false; + expect( schema.checkAttribute( r1bQ, 'listIndent' ) ).to.be.false; } ); it( 'rejects attribute $root>blockQuote[alignment]', () => { @@ -2566,7 +2566,7 @@ describe( 'Schema', () => { } ); it( 'rejects attribute $root>image[indent]', () => { - expect( schema.checkAttribute( r1i, 'indent' ) ).to.be.false; + expect( schema.checkAttribute( r1i, 'listIndent' ) ).to.be.false; } ); it( 'rejects attribute $root>image[alignment]', () => { diff --git a/tests/model/utils/insertcontent.js b/tests/model/utils/insertcontent.js index ddc4bdea0..fbe6b7513 100644 --- a/tests/model/utils/insertcontent.js +++ b/tests/model/utils/insertcontent.js @@ -247,7 +247,7 @@ describe( 'DataController utils', () => { } ); schema.register( 'listItem', { inheritAllFrom: '$block', - allowAttributes: [ 'type', 'indent' ] + allowAttributes: [ 'listType', 'listIndent' ] } ); } ); @@ -370,40 +370,40 @@ describe( 'DataController utils', () => { it( 'inserts one list item', () => { setData( model, 'f[]oo' ); - insertHelper( 'xyz' ); + insertHelper( 'xyz' ); expect( getData( model ) ).to.equal( 'fxyz[]oo' ); } ); it( 'inserts list item to empty element', () => { setData( model, '[]' ); - insertHelper( 'xyz' ); - expect( getData( model ) ).to.equal( 'xyz[]' ); + insertHelper( 'xyz' ); + expect( getData( model ) ).to.equal( 'xyz[]' ); } ); it( 'inserts three list items at the end of paragraph', () => { setData( model, 'foo[]' ); insertHelper( - 'xxx' + - 'yyy' + - 'zzz' + 'xxx' + + 'yyy' + + 'zzz' ); expect( getData( model ) ).to.equal( 'fooxxx' + - 'yyy' + - 'zzz[]' + 'yyy' + + 'zzz[]' ); } ); it( 'inserts two list items to an empty paragraph', () => { setData( model, 'a[]b' ); insertHelper( - 'xxx' + - 'yyy' + 'xxx' + + 'yyy' ); expect( getData( model ) ).to.equal( 'a' + - 'xxx' + - 'yyy[]' + + 'xxx' + + 'yyy[]' + 'b' ); } );