|
|
@@ -73,7 +73,9 @@ export default class LinkCommand extends Command {
|
|
|
writer.setSelection( linkRange );
|
|
|
}
|
|
|
// If not then insert text node with `linkHref` attribute in place of caret.
|
|
|
- else {
|
|
|
+ // However, since selection in collapsed, attribute value will be used as data for text node.
|
|
|
+ // So, if `href` is empty, do not create text node.
|
|
|
+ else if ( href !== '' ) {
|
|
|
const attributes = toMap( selection.getAttributes() );
|
|
|
|
|
|
attributes.set( 'linkHref', href );
|