mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #768 from matthojo/Image-Keyboard-Shortcut
Improved Image keyboard shortcut
This commit is contained in:
commit
2c6dd77b1d
1 changed files with 4 additions and 0 deletions
|
@ -67,7 +67,11 @@
|
||||||
pass = false;
|
pass = false;
|
||||||
break;
|
break;
|
||||||
case "image":
|
case "image":
|
||||||
|
cursor = this.elem.getCursor();
|
||||||
md = this.options.syntax.image.replace('$1', text);
|
md = this.options.syntax.image.replace('$1', text);
|
||||||
|
if (this.elem.getLine(cursor.line) !== "") {
|
||||||
|
md = "\n\n" + md;
|
||||||
|
}
|
||||||
this.elem.replaceSelection(md, "end");
|
this.elem.replaceSelection(md, "end");
|
||||||
cursor = this.elem.getCursor();
|
cursor = this.elem.getCursor();
|
||||||
this.elem.setSelection({line: cursor.line, ch: cursor.ch - 8}, {line: cursor.line, ch: cursor.ch - 1});
|
this.elem.setSelection({line: cursor.line, ch: cursor.ch - 8}, {line: cursor.line, ch: cursor.ch - 1});
|
||||||
|
|
Loading…
Reference in a new issue