Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #44 from ckeditor/t/28
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Reinmar authored May 23, 2017
2 parents 3fb8944 + 0572e5b commit 9d1d5e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/italicengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
8 changes: 4 additions & 4 deletions tests/italicengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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>' );
} );
} );
} );
2 changes: 1 addition & 1 deletion tests/manual/basic-styles.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 9d1d5e2

Please # to comment.