diff --git a/packages/views/editor/content-editor.tsx b/packages/views/editor/content-editor.tsx index 32c1982abd..1457c64b88 100644 --- a/packages/views/editor/content-editor.tsx +++ b/packages/views/editor/content-editor.tsx @@ -157,7 +157,7 @@ const ContentEditor = forwardRef( // Explicit for clarity — the real perf win is useEditorState in BubbleMenu. shouldRerenderOnTransaction: false, onCreate: ({ editor: ed }) => { - lastEmittedRef.current = stripBlobUrls(ed.getMarkdown()); + lastEmittedRef.current = stripBlobUrls(ed.getMarkdown()).trimEnd(); }, content: defaultValue ? preprocessMarkdown(defaultValue) : "", contentType: defaultValue ? "markdown" : undefined, @@ -173,7 +173,7 @@ const ContentEditor = forwardRef( if (!onUpdateRef.current) return; if (debounceRef.current) clearTimeout(debounceRef.current); debounceRef.current = setTimeout(() => { - const md = stripBlobUrls(ed.getMarkdown()); + const md = stripBlobUrls(ed.getMarkdown()).trimEnd(); if (md === lastEmittedRef.current) return; lastEmittedRef.current = md; onUpdateRef.current?.(md);