From aa7f22924d17e1f60ead47a6b68364959c55058b Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Mon, 20 May 2019 14:01:25 +0200 Subject: [PATCH 1/2] Other: `Use model.insertContent` instead of `model.Writer.insert`. --- src/linkcommand.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkcommand.js b/src/linkcommand.js index c28b175..c1dadf5 100644 --- a/src/linkcommand.js +++ b/src/linkcommand.js @@ -81,7 +81,7 @@ export default class LinkCommand extends Command { const node = writer.createText( href, attributes ); - writer.insert( node, position ); + model.insertContent( node, position ); // Create new range wrapping created node. writer.setSelection( writer.createRangeOn( node ) ); From c1da0282f934d95efc1ae96a5f04bd8fd76cf981 Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Mon, 20 May 2019 14:51:17 +0200 Subject: [PATCH 2/2] Tests: Fixed test suite. --- tests/linkcommand.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/linkcommand.js b/tests/linkcommand.js index c382442..32812d4 100644 --- a/tests/linkcommand.js +++ b/tests/linkcommand.js @@ -19,7 +19,7 @@ describe( 'LinkCommand', () => { model.schema.extend( '$text', { allowIn: '$root', - allowAttributes: 'linkHref' + allowAttributes: [ 'linkHref', 'bold' ] } ); model.schema.register( 'p', { inheritAllFrom: '$block' } );