diff --git a/public/js/editor.js b/public/js/editor.js index 4e33b11..97af3ed 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -226,6 +226,12 @@ pimcore.bundle.quill.editor = Class.create({ return true; } else { + if (!textIsSelected) { + const filename = data.text || (data.path || '').split('/').pop() || 'Datei'; + this.activeEditor.insertText(retval.index, filename, 'user'); + this.activeEditor.setSelection(retval.index, filename.length); + retval = this.activeEditor.getSelection(); + } this.activeEditor.format('link', uri); const [leaf, offset] = this.activeEditor.getLeaf(retval.index + 1); if (leaf && leaf.parent.domNode.nodeName === 'A') {