瀏覽代碼

Feature: Marked alignment attribute with the AttributeProperties#isFormatting property.

Marek Lewandowski 6 年之前
父節點
當前提交
50e83320d4

+ 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