diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx index 0aa272e508..edbbea9850 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx @@ -48,10 +48,17 @@ const supportedLocales = require('./supportedLocales'); // so as a workaround we manually add this
for empty documents, // which fixes the issue. // +// However, +//

+// breaks newline behaviour in new notes (see https://github.com/laurent22/joplin/issues/9786). +// Thus, we instead use +//

+// which also seems to work around the list issue. +// // Perhaps upgrading the list plugin (which is a fork of TinyMCE own list plugin) // would help? -function awfulBrHack(html: string): string { - return html === '
' ? '

' : html; +function awfulInitHack(html: string): string { + return html === '
' ? '

' : html; } function findEditableContainer(node: any): any { @@ -875,7 +882,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => { ); if (cancelled) return; - editor.setContent(awfulBrHack(result.html)); + editor.setContent(awfulInitHack(result.html)); if (lastOnChangeEventInfo.current.contentKey !== props.contentKey) { // Need to clear UndoManager to avoid this problem: