mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-01 21:05:13 +08:00
Wrap images inserted with markdown editor with anchor tag to original file ref #1062
This commit is contained in:
parent
85f330c79a
commit
90929baa52
@ -304,7 +304,7 @@ class MarkdownEditor {
|
||||
let cursorPos = this.cm.getCursor('from');
|
||||
window.ImageManager.show(image => {
|
||||
let selectedText = this.cm.getSelection();
|
||||
let newText = "";
|
||||
let newText = "[](" + 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 ;
|
||||
module.exports = MarkdownEditor ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user