Lightbox adds extra line breaks

Consider the following markdown:

Some text![50x50](https://images.unsplash.com/photo-1526047932273-341f2a7631f9)Some text

In the composer preview and in the cooked post if the image is too small to be lightboxed, the result is:
image

But, in the cooked post if the image is lightboxed, the result is:
image

So one might think the issue is that lighbox always creates a block element, but that’s not so simple:

Consider this markdown:

Some text![50x50](https://images.unsplash.com/photo-1526047932273-341f2a7631f9)Some text![50x50](https://images.unsplash.com/photo-1526047932273-341f2a7631f9)Some text

The result is:
image

To be a bug, per the category description, this must prevent normal use of Discourse. I don’t see this preventing anyone from using Discourse in a normal manner. Recategorizing to feature.

4 Likes

Another issue of the same kind, might be related:

Consider the following markdown:

[b]![50x50](https://images.unsplash.com/photo-1526047932273-341f2a7631f9)Should be bold[/b]

In the composer preview and in the cooked post if the image is too small to be lightboxed, the result is:
image
But, in the cooked post if the image is lightboxed, the result is:
image

Mixing bbcode like this is not ideal, bbcode implementation has edge cases, just use markdown.

image test

**![image|81x77](upload://ueXz6mpZt6O2eLHoIbHZ0Fnl4qr.png) test**