Browse Source

Merge pull request #168 from ckeditor/t/ckeditor5-engine/1295

Other: Aligning with new conversion helpers API.
Piotr Jasiun 7 years ago
parent
commit
815c859916

+ 1 - 3
packages/ckeditor5-link/src/linkengine.js

@@ -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( {

+ 1 - 1
packages/ckeditor5-link/tests/linkengine.js

@@ -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>' +