Replace "editor1" with your editor name in the hack below or hack into whatever system you have after the CKE js has loaded. What it does is listens to dialogs closing, when it sees that the link dialog is being hidden and that the current selection begins with an <a...>
link, it takes the contents of said link and cuts it from the final slash.
var editor = CKEDITOR.instances.editor1;
editor.on('dialogHide', function(e) {
if(e.data.getName() === "link") {
var sel = editor.getSelection();
var se = sel.getStartElement();
var text = se.getText();
if(se.getName() === "a") {
var newtext = text.slice(text.lastIndexOf('/')+1);
se.setText(newtext);
}
}
});
It's complicated and disgusting but seems to work. Be warned, I have not tested this if it breaks anything else like anchoring. More checks would be better, like checking if newtext actually gets a value > 1 and only then replacing.