Composer preview shows one more newline under images than what you see in rendered posts

AI-generated summary

Users are discussing a UX issue where the Composer preview adds an extra newline after images, differing from the rendered post content. rishabh first noticed this discrepancy, which has recently started occurring. awesomerobot attributes the issue to hover image resizing controls overlapping images, especially when they are short, and acknowledges it as a known edge case. codinghorror questions the need to optimize for such cases, while awesomerobot confirms the problem and plans to revisit the positioning, noting it’s solvable despite being complex.

It looks like the composer preview is adding one extra newline after an image but cooked post content looks fine as you can see below:


I have not added any space after this image

I have added a single newline after this image


But when you’re composing / editing this post, you’ll see one extra newline being added:

I’m noticing this because it only started happening sometime in the last few months. As someone who uses lots of images in posts, it bothers me a little bit when the composer preview looks different from the actual cooked post content.

5 Likes

This might be a first-of-type or last-of-type spacing css rule?

2 Likes

It’s because of our hover image resizing controls, I’ve been bit by this too and have been meaning to revisit the positioning.

Part of the problem with having the controls over the image is that sometimes images are really short, and in those cases the controls cover the entire image… (might be fine if it’s just on hover?).

8 Likes

That seems like a crazy edge case to optimize for??

1 Like

Problem is illustrated here:

I’m going to take another crack at it next week, it should be solvable even though it’s edgy.

1 Like

I don’t see much value in considering that case at all?