8
0
Просмотр исходного кода

Merge pull request #38 from ckeditor/t/ckeditor5/1664

Feature: Marked alignment as a formatting attribute using the `AttributeProperties#isFormatting` property. Closes ckeditor/ckeditor5#1664.
Maciej 6 лет назад
Родитель
Сommit
23c1e30679

+ 1 - 0
packages/ckeditor5-alignment/src/alignmentediting.js

@@ -41,6 +41,7 @@ export default class AlignmentEditing extends Plugin {
 
 		// Allow alignment attribute on all blocks.
 		schema.extend( '$block', { allowAttributes: 'alignment' } );
+		editor.model.schema.setAttributeProperties( 'alignment', { isFormatting: true } );
 
 		const definition = _buildDefinition( enabledOptions.filter( option => !isDefault( option ) ) );
 

+ 6 - 0
packages/ckeditor5-alignment/tests/alignmentediting.js

@@ -39,6 +39,12 @@ describe( 'AlignmentEditing', () => {
 		expect( model.schema.checkAttribute( [ '$root', '$block' ], 'alignment' ) ).to.be.true;
 	} );
 
+	it( 'its attribute is marked with a formatting property', () => {
+		expect( model.schema.getAttributeProperties( 'alignment' ) ).to.deep.equal( {
+			isFormatting: true
+		} );
+	} );
+
 	describe( 'integration', () => {
 		beforeEach( () => {
 			return VirtualTestEditor