From c34fb4312a7905b055e8d2df7a085508b8057bac Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 7 Aug 2026 22:27:14 +0000 Subject: [PATCH] fix: drop the trailing-break line after an inline atom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A paragraph holding an image rendered a line taller than it does anywhere else: under white-space: pre-wrap the browser already shows the last line, so ProseMirror's hack BR adds an empty one. The hack is kept where it earns its keep — after a real break it carries the caret onto the empty line, and in an empty block it is the only line box there is. --- src/styles/editor.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/styles/editor.css b/src/styles/editor.css index b43cdf4..bdd53ac 100644 --- a/src/styles/editor.css +++ b/src/styles/editor.css @@ -623,6 +623,13 @@ color: var(--color-primary); } +/* After an inline atom ProseMirror's trailing-break BR adds a line the block has not + got, so a paragraph holding an image renders one too tall. Kept after a real BR + (it carries the caret onto the empty line) and in an empty block (its only line). */ +.paper .tiptap :not(br) + br.ProseMirror-trailingBreak { + display: none; +} + /* Empty block fix: a paragraph/heading/li-paragraph holding only the ProseMirror trailing-break BR would render the inline ¶ on a second line, doubling its height. Pull ::after out of flow. Applied always so the reserved ¶ stays zero-height. */