1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

Merge pull request #925 from matthojo/New-line

Added new paragraph keyboard shortcut
This commit is contained in:
Hannah Wolfe 2013-10-09 11:32:43 -07:00
commit 58edf713bc
3 changed files with 15 additions and 1 deletions

View file

@ -116,6 +116,13 @@
this.elem.replaceSelection(md, 'end');
pass = false;
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);

View file

@ -83,6 +83,11 @@
<td></td>
<td>Ctrl + Alt + W</td>
</tr>
<tr>
<td>New Paragraph</td>
<td></td>
<td>Ctrl / Cmd + Enter</td>
</tr>
<tr>
<td>Uppercase</td>
<td></td>

View file

@ -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]*?)>\}/;