Browse Source

Merge pull request #44 from ckeditor/t/28

Other: Italic feature will use `<i>` instead of `<em>`. Closes #28.

Read more in [Editor Recommendations](http://ckeditor.github.io/editor-recommendations/features/italic.html).
Piotrek Koszuliński 8 years ago
parent
commit
75d86020fc

+ 1 - 1
packages/ckeditor5-basic-styles/src/italicengine.js

@@ -37,7 +37,7 @@ export default class ItalicEngine extends Plugin {
 		// Build converter from model to view for data and editing pipelines.
 		buildModelConverter().for( data.modelToView, editing.modelToView )
 			.fromAttribute( ITALIC )
-			.toElement( 'em' );
+			.toElement( 'i' );
 
 		// Build converter from view to model for data pipeline.
 		buildViewConverter().for( data.viewToModel )

+ 4 - 4
packages/ckeditor5-basic-styles/tests/italicengine.js

@@ -53,7 +53,7 @@ describe( 'ItalicEngine', () => {
 			expect( getModelData( doc, { withoutSelection: true } ) )
 				.to.equal( '<paragraph><$text italic="true">foo</$text>bar</paragraph>' );
 
-			expect( editor.getData() ).to.equal( '<p><em>foo</em>bar</p>' );
+			expect( editor.getData() ).to.equal( '<p><i>foo</i>bar</p>' );
 		} );
 
 		it( 'should convert <i> to italic attribute', () => {
@@ -62,7 +62,7 @@ describe( 'ItalicEngine', () => {
 			expect( getModelData( doc, { withoutSelection: true } ) )
 				.to.equal( '<paragraph><$text italic="true">foo</$text>bar</paragraph>' );
 
-			expect( editor.getData() ).to.equal( '<p><em>foo</em>bar</p>' );
+			expect( editor.getData() ).to.equal( '<p><i>foo</i>bar</p>' );
 		} );
 
 		it( 'should convert font-weight:italic to italic attribute', () => {
@@ -71,7 +71,7 @@ describe( 'ItalicEngine', () => {
 			expect( getModelData( doc, { withoutSelection: true } ) )
 				.to.equal( '<paragraph><$text italic="true">foo</$text>bar</paragraph>' );
 
-			expect( editor.getData() ).to.equal( '<p><em>foo</em>bar</p>' );
+			expect( editor.getData() ).to.equal( '<p><i>foo</i>bar</p>' );
 		} );
 
 		it( 'should be integrated with autoparagraphing', () => {
@@ -90,7 +90,7 @@ describe( 'ItalicEngine', () => {
 		it( 'should convert attribute', () => {
 			setModelData( doc, '<paragraph><$text italic="true">foo</$text>bar</paragraph>' );
 
-			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<p><em>foo</em>bar</p>' );
+			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<p><i>foo</i>bar</p>' );
 		} );
 	} );
 } );

+ 1 - 1
packages/ckeditor5-basic-styles/tests/manual/basic-styles.html

@@ -1,3 +1,3 @@
 <div id="editor">
-	<p><em>This</em> is an <strong>editor</strong> instance.</p>
+	<p><i>This</i> is an <strong>editor</strong> instance.</p>
 </div>