]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'master' of git://github.com/thomasjsn/BookStack into thomasjsn-master
authorDan Brown <redacted>
Sat, 10 Nov 2018 15:23:29 +0000 (15:23 +0000)
committerDan Brown <redacted>
Sat, 10 Nov 2018 15:23:29 +0000 (15:23 +0000)
resources/assets/js/components/markdown-editor.js

index 6eba242d0c71e979d55c1d5bcbd38315a69375a9..dd58a0ece4c2daaac6304fea56b495dc47558192 100644 (file)
@@ -304,7 +304,7 @@ class MarkdownEditor {
         let cursorPos = this.cm.getCursor('from');
         window.ImageManager.show(image => {
             let selectedText = this.cm.getSelection();
-            let newText = "![" + (selectedText || image.name) + "](" + image.thumbs.display + ")";
+            let newText = "[![" + (selectedText || image.name) + "](" + image.thumbs.display + ")](" + image.url + ")";
             this.cm.focus();
             this.cm.replaceSelection(newText);
             this.cm.setCursor(cursorPos.line, cursorPos.ch + newText.length);
@@ -427,4 +427,4 @@ class MarkdownEditor {
 
 }
 
-export default MarkdownEditor ;
\ No newline at end of file
+export default MarkdownEditor ;