All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
16 lines
346 B
JavaScript
16 lines
346 B
JavaScript
import isHotkey from 'is-hotkey';
|
|
|
|
function LineBreak() {
|
|
return {
|
|
onKeyDown(event, editor, next) {
|
|
const isShiftEnter = isHotkey('shift+enter', event);
|
|
if (!isShiftEnter) {
|
|
return next();
|
|
}
|
|
return editor.insertInline('break').insertText('').moveToStartOfNextText();
|
|
},
|
|
};
|
|
}
|
|
|
|
export default LineBreak;
|