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 #168 from ckeditor/t/ckeditor5-engine/1295
Browse files Browse the repository at this point in the history
Other: Aligning with new conversion helpers API.
  • Loading branch information
Piotr Jasiun authored Feb 19, 2018
2 parents 6df4c55 + 0dade11 commit 592d38c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/linkengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ export default class LinkEngine extends Plugin {
// Allow link attribute on all inline nodes.
editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } );

const linkElementCreator = ( href, data, consumable, api ) => createLinkElement( href, api.writer );

editor.conversion.for( 'downcast' )
.add( downcastAttributeToElement( 'linkHref', { view: linkElementCreator } ) );
.add( downcastAttributeToElement( { model: 'linkHref', view: createLinkElement } ) );

editor.conversion.for( 'upcast' )
.add( upcastElementToAttribute( {
Expand Down
2 changes: 1 addition & 1 deletion tests/linkengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe( 'LinkEngine', () => {
it( 'should should set priority for `linkHref` higher than all other attribute elements', () => {
model.schema.extend( '$text', { allowAttributes: 'foo' } );

editor.conversion.for( 'downcast' ).add( downcastAttributeToElement( 'foo', { view: 'f' } ) );
editor.conversion.for( 'downcast' ).add( downcastAttributeToElement( { model: 'foo', view: 'f' } ) );

setModelData( model,
'<paragraph>' +
Expand Down

0 comments on commit 592d38c

Please sign in to comment.