diff --git a/packages/ckeditor5-link/src/linkediting.js b/packages/ckeditor5-link/src/linkediting.js index e528c2b6681..d98fb6d3af6 100644 --- a/packages/ckeditor5-link/src/linkediting.js +++ b/packages/ckeditor5-link/src/linkediting.js @@ -195,7 +195,7 @@ export default class LinkEditing extends Plugin { model: decorator.id, view: ( manualDecoratorValue, { writer, schema }, { item } ) => { // Manual decorators for block links are handled e.g. in LinkImageEditing. - if ( !schema.isInline( item ) ) { + if ( !( item.is( 'selection' ) || schema.isInline( item ) ) ) { return; } diff --git a/packages/ckeditor5-link/tests/linkediting.js b/packages/ckeditor5-link/tests/linkediting.js index bd272f61a3c..f5df9c43066 100644 --- a/packages/ckeditor5-link/tests/linkediting.js +++ b/packages/ckeditor5-link/tests/linkediting.js @@ -938,6 +938,14 @@ describe( 'LinkEditing', () => { await editor.destroy(); } ); } ); + + it( 'should downcast manual decorator on document selection', () => { + setModelData( model, '<$text linkHref="url" linkIsExternal="true">foo[]bar' ); + + expect( getViewData( editor.editing.view ) ).to.equal( + '

foo{}bar

' + ); + } ); } ); describe( 'link following', () => {