From 4f24219aaf2e222af4120f417c11dbbf295685ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Fri, 23 Jun 2017 14:52:50 +0200 Subject: [PATCH] Fix: It will be possible to paste links. See https://github.com/ckeditor/ckeditor5/issues/477. --- src/linkengine.js | 2 ++ tests/linkengine.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/linkengine.js b/src/linkengine.js index 1e32f28..7862253 100644 --- a/src/linkengine.js +++ b/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 ) diff --git a/tests/linkengine.js b/tests/linkengine.js index 0650ff3..f6bb9a3 100644 --- a/tests/linkengine.js +++ b/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', () => {