# GitHub onebox wrongly adds extra empty lines after each code line in the emails

**URL:** <https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240>\
**Category:** Bug\
**Created:** [2016年四月26日 12:12 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240 "2016-04-26T12:12:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)\
**Post date:** [2016年四月26日 12:12 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240/1 "2016-04-26T12:12:54Z")

</div>

An original code (correct rendering):

> <https://github.com/magento/magento2/blob/720667e/lib/internal/Magento/Framework/DB/Transaction.php#L49-L60>

A email with the code (wrong rendering: extra empty lines are added, the screenshot is taken in the GMail web interface):

 ![](https://global.discourse-cdn.com/meta/original/3X/c/8/c8f6e3a6070ec6f0fc13d89ce0e5a065471ba971.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:** [2016年四月28日 00:56 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240/2 "2016-04-28T00:56:57Z")

</div>

Are you sure there are empty lines there and its not simply that the CSS is a bit off?

---

<div class="post-metadata">

**Author:** ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)\
**Post date:** [2016年四月28日 23:44 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240/3 "2016-04-28T23:44:53Z")

</div>

The line breaks between the `<li>` tags are preserved because the code is inside the [`<pre>`](http://www.w3schools.com/tags/tag_pre.asp) tag.  
Additionally, each line of code has a bottom padding of 10px:

 ![](https://global.discourse-cdn.com/meta/original/3X/8/8/887de9f0897e83f3bd718b705e33e9435460a385.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/c/a/cae672d896d5d20b4ae88cf06a4dba3dfe7e8d51.png)

---

<div class="post-metadata">

**Author:** ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)\
**Post date:** [2017年一月19日 08:42 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240/4 "2017-01-19T08:42:20Z")

</div>

Now it became even worse: the violet background now covers only a part of the code block:

 ![](https://global.discourse-cdn.com/meta/original/3X/f/5/f5a9e03c3e8481602f344f6ab04f368c79ab2f72.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:** [2022年七月21日 06:56 UTC](https://meta.discourse.org/t/github-onebox-wrongly-adds-extra-empty-lines-after-each-code-line-in-the-emails/43240/5 "2022-07-21T06:56:43Z")

</div>

已经解决一段时间了
