Skip to content

Commit

Permalink
fix(plaintext): allow adding multiple empty lines at the end
Browse files Browse the repository at this point in the history
Pressing enter three times exits a CodeBlock element by default.
Disable this by setting `exitOnTripleEnter` to false in plaintext editor.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Dec 10, 2024
1 parent e738295 commit 0696c1d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/EditorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 0696c1d

Please sign in to comment.