0👍
I was looking to do something similar, but rather execute shiftEnter instead of enter, perhaps my investigations on this will help others landing here. A combination of these two sources answered the question for me:
- https://github.com/ckeditor/ckeditor5-vue/issues/58
- In ckeditor5, how can I change entermode br instead of p?
Essentially adding a function like below (i.e. from In ckeditor5, how can I change entermode br instead of p?) in a seperate file…
export function ckEditorEnterBreaks(editor) {
editor.editing.view.document.on('enter', (evt, data) => {
//shift + enter creates a br tag
editor.execute('shiftEnter');
//cancel enter event to prevent p tag
data.preventDefault();
evt.stop();
});
}
…importing it and adding to the editorConfig plugins:
editorConfig {
plugins: [ckEditorEnterBreaks]
}
Source:stackexchange.com