From 9c7fee9f5cf4aaaa9fe293f3dfe526a2b43aa3a5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 5 Oct 2026 21:03:38 -0400 Subject: [PATCH] fix: Align consecutive floated images horizontally (#13900) * fix: Align consecutive floated images horizontally * fix: Align floated images in static HTML --- shared/editor/components/Styles.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index 4ecdcddcd4..07069ec53b 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1063,6 +1063,21 @@ img.ProseMirror-separator { display: none; } +// Let paragraphs of floated images collapse so consecutive floats line up +p:has(> .component-image > .image-left-50, > .component-image > .image-right-50) { + min-height: 0; +} + +// In static HTML the parser lifts floats out of their paragraph, leaving empty ones +p:empty:has(+ .image-left-50, + .image-right-50), +:is(.image-left-50, .image-right-50) + br.ProseMirror-trailingBreak + p:empty { + min-height: 0; +} + +:is(.image-left-50, .image-right-50) + br.ProseMirror-trailingBreak { + display: none; +} + .${EditorStyleHelper.imageCaption} { border: 0; display: block;