]> BookStack Code Mirror - bookstack/commitdiff
Wrap images inserted with markdown editor with anchor tag to original file ref #1062 1064/head
authorThomas Jensen <redacted>
Sat, 13 Oct 2018 19:43:35 +0000 (21:43 +0200)
committerThomas Jensen <redacted>
Sat, 13 Oct 2018 19:43:35 +0000 (21:43 +0200)
resources/assets/js/components/markdown-editor.js

index a555376e8eaca5094620b3c3fe03a68824c8acca..88b61f0beeac9c871910b87063fa22b708793661 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 {
 
 }
 
-module.exports = MarkdownEditor ;
\ No newline at end of file
+module.exports = MarkdownEditor ;