diff --git a/core/client/markdown-actions.js b/core/client/markdown-actions.js index c3bb14fac1..599329e056 100644 --- a/core/client/markdown-actions.js +++ b/core/client/markdown-actions.js @@ -114,6 +114,13 @@ case "currentDate": md = moment(new Date()).format("D MMMM YYYY"); break; + case 'newLine': + cursor = this.elem.getCursor(); + if (this.elem.getLine(cursor.line) !== "") { + this.elem.setLine(cursor.line, this.elem.getLine(cursor.line) + "\n\n"); + } + pass = false; + break; default: if (this.options.syntax[this.style]) { md = this.options.syntax[this.style].replace('$1', text); diff --git a/core/client/tpl/modals/markdown.hbs b/core/client/tpl/modals/markdown.hbs index 2b0af04918..98b89ab25d 100644 --- a/core/client/tpl/modals/markdown.hbs +++ b/core/client/tpl/modals/markdown.hbs @@ -83,6 +83,11 @@ Ctrl + Alt + W + + New Paragraph + + Ctrl / Cmd + Enter + Uppercase diff --git a/core/client/views/editor.js b/core/client/views/editor.js index 904231bf47..3af8157470 100644 --- a/core/client/views/editor.js +++ b/core/client/views/editor.js @@ -33,7 +33,9 @@ {'key': 'Ctrl+Alt+W', 'style': 'selectword'}, {'key': 'Ctrl+L', 'style': 'list'}, {'key': 'Ctrl+Alt+C', 'style': 'copyHTML'}, - {'key': 'Meta+Alt+C', 'style': 'copyHTML'} + {'key': 'Meta+Alt+C', 'style': 'copyHTML'}, + {'key': 'Meta+Enter', 'style': 'newLine'}, + {'key': 'Ctrl+Enter', 'style': 'newLine'} ], imageMarkdownRegex = /^(?:\{<(.*?)>\})?!(?:\[([^\n\]]*)\])(?:\(([^\n\]]*)\))?$/gim, markerRegex = /\{<([\w\W]*?)>\}/;