Lightbox adds extra line breaks

AI-generated summary

The discussion revolves around an issue with Lightbox adding extra line breaks in Discourse. jack2 provides examples of Markdown code where this issue occurs, showing that the result changes when the image is lightboxed. codinghorror considers this a feature rather than a bug, as it does not prevent normal use of Discourse. jack2 shares another related issue where the problem occurs with bold text. sam suggests avoiding mixing BBCode with Markdown, recommending the use of Markdown instead, and provides examples of correct Markdown usage.

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:

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:

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**