diff -r 40e26009689c -r c925ae656709 ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js --- a/ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js Sat Dec 17 03:31:51 2016 +0300 +++ b/ckeditor/plugins/crossreference/dialogs/crossreference-anchor.js Wed Dec 21 17:20:19 2016 +0300 @@ -88,7 +88,7 @@ this.element = selection.getStartElement(); if (this.element) this.element = this.element.getAscendant('a', true); - if (!this.element || this.element.getName() != 'a') { + if (!this.element || this.element.getName() != 'a' || !this.element.hasAttribute('cross-anchor')) { this.element = editor.document.createElement('a'); var guid = generateUUID(); this.element.setAttribute('cross-guid', guid); @@ -97,7 +97,9 @@ this.insertMode = false; } - if (!this.insertMode) + if (this.insertMode) + this.setValueOf('tab-main', 'name', selection.getSelectedText().trim()); + else this.setupContent(this.element); },