# Lightbox adds extra line breaks

**URL:** https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942
**Category:** Feature
**Created:** [March 28, 2020, 1:19pm UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942 "2020-03-28T13:19:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)
#### Post date: [March 28, 2020, 1:19pm UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942/1 "2020-03-28T13:19:01Z")

</div>

Consider the following markdown:

```plaintext
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](https://global.discourse-cdn.com/meta/original/3X/9/c/9cccc221315ad96aa007ef3485877a6d60302a69.png)

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

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/f/1f7015f85fb1bdfe970c999aee5e2c88047cdf53.png)

---

<div class="post-metadata">

### Author: ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)
#### Post date: [March 28, 2020, 1:23pm UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942/2 "2020-03-28T13:23:34Z")

</div>

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

Consider this markdown:

```plaintext
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](https://global.discourse-cdn.com/meta/original/3X/c/f/cf1b241837bc851415bba586e6cdb9ee676e782c.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 29, 2020, 2:36am UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942/3 "2020-03-29T02:36:47Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)
#### Post date: [March 29, 2020, 12:41pm UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942/4 "2020-03-29T12:41:56Z")

</div>

Another issue of the same kind, might be related:

Consider the following markdown:

```plaintext
[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](https://global.discourse-cdn.com/meta/original/3X/3/4/34e12ee2a6c45d9b71d9404ae4d8a6007050549b.png)  
But, in the cooked post if the image is lightboxed, the result is:  
 ![image](https://global.discourse-cdn.com/meta/original/3X/0/8/08ef55bd09445132117c5d7ba8ee0ad8e42cd3ba.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 30, 2020, 3:51am UTC](https://meta.discourse.org/t/lightbox-adds-extra-line-breaks/145942/5 "2020-03-30T03:51:15Z")

</div>

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

**![image](https://global.discourse-cdn.com/meta/original/3X/d/3/d3f2284d7ec30b80735f9c70c8455e4f4c4c3f9f.png) test**

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