# Inconsistent internal onebox spacing

**URL:** https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890
**Category:** UX
**Created:** [March 26, 2018, 6:27pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890 "2018-03-26T18:27:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [March 26, 2018, 6:27pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/1 "2018-03-26T18:27:14Z")

</div>

When two internal links are added to a topic the spacing between them is inconsistent. If no blank line is between the links the spacing is significantly greater than if a blank line is provided.

```plaintext
https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446
https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

```

> [@Discourse 2.0.0.beta4 Release Notes](https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446):
>
> New features in 2.0.0.beta4 Two Factor Authentication via TOTP Thanks to community contributor @awole20 we now support Two Factor Authentication on Discourse! Two Factor Authentication can be enabled from a user’s preferences page. After verifying their password a user is prompted to scan the QR code via a supported app on their mobile device. After enabling Two Factor Authentication all existing login sessions are invalidated (you’ll need to log into all browsers again). …

> [@Discourse 2.0.0.beta5 Release Notes](https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881):
>
> New features in 2.0.0.beta5 Shared Drafts Shared drafts allow site staff to quickly and easily collaborate on a topic draft prior to making it public. To create a shared draft click the reply icon in the top left of the composer and select Shared Draft. After the draft is created all staff can make edits prior to publishing the topic. Once published the timestamp(s) will be reset, and the edit history removed. For more details see the feature announcement at [Shared Drafts: Allow staff…](https://meta.discourse.org/t/shared-drafts-allow-staff-to-collaborate-on-posts-before-publishing/83493)

```plaintext
https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446

https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

```

> [@Discourse 2.0.0.beta4 Release Notes](https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446):
>
> New features in 2.0.0.beta4 Two Factor Authentication via TOTP Thanks to community contributor @awole20 we now support Two Factor Authentication on Discourse! Two Factor Authentication can be enabled from a user’s preferences page. After verifying their password a user is prompted to scan the QR code via a supported app on their mobile device. After enabling Two Factor Authentication all existing login sessions are invalidated (you’ll need to log into all browsers again). …

> [@Discourse 2.0.0.beta5 Release Notes](https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881):
>
> New features in 2.0.0.beta5 Shared Drafts Shared drafts allow site staff to quickly and easily collaborate on a topic draft prior to making it public. To create a shared draft click the reply icon in the top left of the composer and select Shared Draft. After the draft is created all staff can make edits prior to publishing the topic. Once published the timestamp(s) will be reset, and the edit history removed. For more details see the feature announcement at [Shared Drafts: Allow staff…](https://meta.discourse.org/t/shared-drafts-allow-staff-to-collaborate-on-posts-before-publishing/83493)

cc @awesomerobot

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [March 26, 2018, 6:36pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/2 "2018-03-26T18:36:42Z")

</div>

Oddly enough, when there’s no line between the two we add a `<br>` to the markup and when there is a line between the two we don’t.

---

<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 26, 2018, 10:14pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/3 "2018-03-26T22:14:58Z")

</div>

Hmm, what do you recommend to fix?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [March 27, 2018, 3:15am UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/4 "2018-03-27T03:15:04Z")

</div>

Ah, I understand why this happens now (bear with me here)…

If I type:

```plaintext
word
word

```

…I intentionally put a single carriage return there, so it correctly renders as:

```HTML
<p>
    word
    <br>
    word
</p>

```

When I type:

```plaintext
word

word

```

…this is two returns, so the markup is correctly output as two paragraphs:

```HTML
<p>
    word
</p>
<p>
    word
</p>

```

But with oneboxes, we’re treating them as they’re input (two strings with a single carriage return) and not as they’re output (two separate HTML elements)…

For example, when I type:

```plaintext
https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446
https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

```

…the output is:

```HTML
<aside>
</aside>
<br>
<aside>
</aside>

```

This is _technically_ correct for the input. I entered two lines with a carriage return between them… but I was required to put that carriage return there for the oneboxes to exist. We shouldn’t count that carriage return because it’s a prerequisite to generate oneboxes. I’m not doing it for the purpose of creating a new line of text (so there shouldn’t be a `<br>` there).

When I type:

```plaintext
https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446

https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

```

…the output is:

```HTML
<aside>
</aside>
<aside>
</aside>

```

This would be correct if they were two paragraphs, which is how the text is input, but not how it’s output. We _should_ add a `<br>` here, because I’m adding a space that doesn’t need to be there (intentionally dividing the content).

---

<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: [February 13, 2020, 7:17pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/6 "2020-02-13T19:17:31Z")

</div>

Still an issue apparently 🙂

---

<div class="post-metadata">

### Author: ![stance455](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stance455/32/255345_2.png) [@stance455](https://meta.discourse.org/u/stance455)
#### Post date: [May 12, 2022, 1:16pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/7 "2022-05-12T13:16:37Z")

</div>

Apologies for bringing this one back up but thought I could piggyback off this topic (instead of starting a new one…)

Im sure this is well known but with the onebox internal link, if it’s expanded it looks good- but by default, the view has no formatting.

Before expanding…

 ![Screen Shot 2022-05-12 at 4.08.19 PM](https://global.discourse-cdn.com/meta/original/4X/d/7/f/d7f5f3ab2975ee7b37b06ef3a1e8ce525e5a0f71.png)

When you expand it looks good.

 ![Screen Shot 2022-05-12 at 4.08.26 PM](https://global.discourse-cdn.com/meta/original/4X/f/e/5/fe5d2f7b234fb8cd886daf797a9ef2a0ac5a4cd6.png)

Unless the OP quotes text, shouldn’t the preview hold the formatting - instead of trying to fit as much text as possible into the box?

Or am I missing something and all this is by design?

---

<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: [May 12, 2022, 9:16pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/8 "2022-05-12T21:16:35Z")

</div>

Correct, there is no formatting before expansion, because otherwise you couldn’t fit much text in there.

---

<div class="post-metadata">

### Author: ![stance455](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stance455/32/255345_2.png) [@stance455](https://meta.discourse.org/u/stance455)
#### Post date: [May 13, 2022, 8:10pm UTC](https://meta.discourse.org/t/inconsistent-internal-onebox-spacing/83890/9 "2022-05-13T20:10:57Z")

</div>

Ah I see, I imagine it’s been that way for a while.

IMHO, from a UI perspective, wouldn’t it be “cleaner” to see what post Im getting into , instead of the scrunched up version.

If the OP of the post wants to highlight specfic text , he can quote and it looks great.

I feel like if they’re linking the post, they may want us to click the post, or at least expand and get some context.

From a pure numbers game, I imagine more people would click or expand a post with proper formatting. Just easier to look at.

Lets not forget the majority of discourse users are not coders or programmers. Seeing text bunched up in a box like that is not something they’re used to seeing.

 ![Screen Shot 2022-05-12 at 4.08.19 PM](https://global.discourse-cdn.com/meta/original/4X/d/7/f/d7f5f3ab2975ee7b37b06ef3a1e8ce525e5a0f71.png)

vs

 ![Screen Shot 2022-05-13 at 11.00.59 PM](https://global.discourse-cdn.com/meta/original/4X/7/8/e/78e59b540cd2d9b7f2bd5debf43722764fa68e4c.png)

..again, just an opinion.
