From 0696c1dad495307dfe438de97f41ad1f0a4e66c3 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 8 Oct 2024 10:36:30 +0200 Subject: [PATCH] fix(plaintext): allow adding multiple empty lines at the end Pressing enter three times exits a CodeBlock element by default. Disable this by setting `exitOnTripleEnter` to false in plaintext editor. Signed-off-by: Max --- src/EditorFactory.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/EditorFactory.js b/src/EditorFactory.js index 319e8f1ec65..39cd350dd59 100644 --- a/src/EditorFactory.js +++ b/src/EditorFactory.js @@ -67,7 +67,14 @@ const createEditor = ({ language, onCreate = () => {}, onUpdate = () => {}, exte FocusTrap, ] } else { - defaultExtensions = [PlainText, CodeBlockLowlight.configure({ lowlight, defaultLanguage: language })] + defaultExtensions = [ + PlainText, + CodeBlockLowlight.configure({ + lowlight, + defaultLanguage: language, + exitOnTripleEnter: false, + }), + ] } return new Editor({