]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/config.js
Editors: Updated entity link select to pre-fill with selection
[bookstack] / resources / js / wysiwyg / config.js
index d93c9644e5db99b7e77af8bdb0194b14adc516d1..984081bd602f2c7efc1ae3c175008a9bec3b63da 100644 (file)
@@ -78,12 +78,13 @@ function filePickerCallback(callback, value, meta) {
     if (meta.filetype === 'file') {
         /** @type {EntitySelectorPopup} * */
         const selector = window.$components.first('entity-selector-popup');
+        const selectionText = this.selection.getContent({format: 'text'}).trim();
         selector.show(entity => {
             callback(entity.link, {
                 text: entity.name,
                 title: entity.name,
             });
-        });
+        }, selectionText);
     }
 
     if (meta.filetype === 'image') {