From 74cda4e2ab13a848395c10258f34d2010c5debae Mon Sep 17 00:00:00 2001 From: chaNcharge <11594018+chaNcharge@users.noreply.github.com> Date: Wed, 17 Apr 2024 02:19:25 -0700 Subject: [PATCH] Desktop: Resolves #10315: Do not trim markdown upon saving in rich text (#10321) --- .../gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.ts index 3fdb69ed81..7e50f7cf36 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/openEditDialog.ts @@ -95,7 +95,7 @@ export default function openEditDialog(editor: any, markupToHtml: any, dispatchD // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied onSubmit: async (dialogApi: any) => { const newSource = newBlockSource(dialogApi.getData().languageInput, dialogApi.getData().codeTextArea, source); - const md = `${newSource.openCharacters}${newSource.content.trim()}${newSource.closeCharacters}`; + const md = `${newSource.openCharacters}${newSource.content}${newSource.closeCharacters}`; const result = await markupToHtml.current(MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN, md, { bodyOnly: true }); // markupToHtml will return the complete editable HTML, but we only