Explorar el Código

Fix: It will be possible to paste links. See https://github.com/ckeditor/ckeditor5/issues/477.

Piotrek Koszuliński hace 8 años
padre
commit
0b87814744

+ 2 - 0
packages/ckeditor5-link/src/linkengine.js

@@ -32,6 +32,8 @@ export default class LinkEngine extends Plugin {
 
 		// Allow link attribute on all inline nodes.
 		editor.document.schema.allow( { name: '$inline', attributes: 'linkHref', inside: '$block' } );
+		// Temporary workaround. See https://github.com/ckeditor/ckeditor5/issues/477.
+		editor.document.schema.allow( { name: '$inline', attributes: 'linkHref', inside: '$clipboardHolder' } );
 
 		// Build converter from model to view for data and editing pipelines.
 		buildModelConverter().for( data.modelToView, editing.modelToView )

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

@@ -34,6 +34,7 @@ describe( 'LinkEngine', () => {
 	it( 'should set proper schema rules', () => {
 		expect( doc.schema.check( { name: '$inline', attributes: [ 'linkHref' ], inside: '$root' } ) ).to.be.false;
 		expect( doc.schema.check( { name: '$inline', attributes: [ 'linkHref' ], inside: '$block' } ) ).to.be.true;
+		expect( doc.schema.check( { name: '$inline', attributes: [ 'linkHref' ], inside: '$clipboardHolder' } ) ).to.be.true;
 	} );
 
 	describe( 'command', () => {