0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Koenig - Fix error on SHIFT+ENTER whilst a card is selected

refs https://github.com/TryGhost/Ghost/issues/9505
- a card section isn't markerable so a guard is needed to prevent inserting the soft-break atom
This commit is contained in:
Kevin Ansfield 2018-04-10 15:34:12 +01:00
parent 2c8a28f77a
commit d87787c47c

View file

@ -6,6 +6,10 @@ export default function (editor) {
str: 'SHIFT+ENTER', str: 'SHIFT+ENTER',
run(editor) { run(editor) {
if (!editor.range.headSection.isMarkerable) {
return;
}
editor.run((postEditor) => { editor.run((postEditor) => {
let softReturn = postEditor.builder.createAtom('soft-return'); let softReturn = postEditor.builder.createAtom('soft-return');
postEditor.insertMarkers(editor.range.head, [softReturn]); postEditor.insertMarkers(editor.range.head, [softReturn]);