# Code tags don't support blank lines

**URL:** https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258
**Category:** Support
**Tags:** markdown-it-review
**Created:** [April 8, 2016, 8:07pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258 "2016-04-08T20:07:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Drew\_Warwick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/drew_warwick/32/80591_2.png) [@Drew\_Warwick](https://meta.discourse.org/u/Drew_Warwick)
#### Post date: [April 8, 2016, 8:07pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258/1 "2016-04-08T20:07:05Z")

</div>

Easy repro. This code should have two empty lines but doesn’t:

```plaintext
TestFunction() {

}

TestFunction()
```

Discourse syntax:

 ![](https://global.discourse-cdn.com/meta/original/4X/b/2/e/b2eb1bc5ceca12c93c891efcd9925358c8eaed30.png)

When posting code on a Discourse forum, it can get really messy without the whitespace included for readability. It supports tabs, spacing, and whatnot, but for some reason it doesn’t allow blank newlines. I’m not sure if this is unintended or not, but it’d be great if text in code tags allowed blank lines to preserve the original formatting. It should allow infinite blank lines as well: there really isn’t an issue of preventable spamming because someone could just put a single character on each line and achieve the same effect.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [April 8, 2016, 8:19pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258/2 "2016-04-08T20:19:31Z")

</div>

```
test() {

}

test()
```

I use `<pre> your code </pre>`

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [April 8, 2016, 8:20pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258/3 "2016-04-08T20:20:40Z")

</div>

You can use Markdown for code blocks.  
[http://commonmark.org/help/tutorial/07-code.html](http://commonmark.org/help/tutorial/07-code.html)

---

<div class="post-metadata">

### Author: ![Drew\_Warwick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/drew_warwick/32/80591_2.png) [@Drew\_Warwick](https://meta.discourse.org/u/Drew_Warwick)
#### Post date: [April 8, 2016, 8:22pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258/4 "2016-04-08T20:22:49Z")

</div>

Thanks @Trash @gerhard – I’ll use those then.

I assume the Discourse staff would still want to either fix or remove the code tags though since they do have an issue.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 9, 2016, 12:56pm UTC](https://meta.discourse.org/t/code-tags-dont-support-blank-lines/42258/5 "2016-04-09T12:56:46Z")

</div>


