diff --git a/ghost/admin/markdown-actions.js b/ghost/admin/markdown-actions.js index 070c22b7ca..43d693d62f 100644 --- a/ghost/admin/markdown-actions.js +++ b/ghost/admin/markdown-actions.js @@ -67,7 +67,11 @@ pass = false; break; case "image": + cursor = this.elem.getCursor(); md = this.options.syntax.image.replace('$1', text); + if (this.elem.getLine(cursor.line) !== "") { + md = "\n\n" + md; + } this.elem.replaceSelection(md, "end"); cursor = this.elem.getCursor(); this.elem.setSelection({line: cursor.line, ch: cursor.ch - 8}, {line: cursor.line, ch: cursor.ch - 1});