# Code blocks not working correctly?

**URL:** <https://meta.discourse.org/t/code-blocks-not-working-correctly/35451>\
**Category:** Bug\
**Created:** [2015 年 11 月 11 日午前 11:18 UTC](https://meta.discourse.org/t/code-blocks-not-working-correctly/35451 "2015-11-11T11:18:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gmanjapan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gmanjapan/32/107304_2.png) [@gmanjapan](https://meta.discourse.org/u/gmanjapan)\
**Post date:** [2015 年 11 月 11 日午前 11:18 UTC](https://meta.discourse.org/t/code-blocks-not-working-correctly/35451/1 "2015-11-11T11:18:34Z")

</div>

Here’s a code block below showing how to do code blocks. It works

````
```JavaScript
function some(JavaScript, "code") {}
```

````

Then here’s the same code block without the indent. That works too

```JavaScript
function some(JavaScript, "code") {}

```

Then here’s another code block of a code block just like the first one above. It is not working in fact it’s showing up directly inline in this paragraph for some reason

````
```
function some(JavaScript, "code");
```

````

And finally another unindented code block half works (not sure why it’s not highlighted the string same as 2 blocks up

```javascript
function some(JavaScript, "code"){}

```

I can guess the second half issue is because I used `JavaScript` above and `javascript` below. I actually came here to propose and possibly implement that being case insensitive. Funny though, in my installation of discourse I get the opposite behavior. `JavaScript` has less highlighting than `javascript`.

* * *

#update

Let’s try this again

 ![screenshot](https://global.discourse-cdn.com/meta/original/4X/1/9/c/19cc1ad549b2cf7766c7fbc5a2d2baaf3e70b029.png)

and here’s a screenshot of the issue. The red area on the left is functionally identical to the green area on the left but the green area is not getting converted to a code block the same as the red area

[Here’s the raw content of the post](http://pastebin.com/rLFH5a3T) so you can try it yourself.

Hopefully you’ll now see the bug

---

_[View the full topic](https://meta.discourse.org/t/code-blocks-not-working-correctly/35451)._
