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 ) ); 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' } );