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
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
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.
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
This is often because the user has entered an invalid language code in the backticks block. Several topics about that here already, this user error comes up a lot for some reason.
I’d be happy if you’d point out the invalid language code that’s breaking the example I posted because for some reason I’m blind to it. In fact the block that’s broken is indented so it doesn’t have a language code.
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
function some(JavaScript, "code") {}
Then here’s another code block with an indent. 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
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.
Note that you really need a space between the triple backticks block and the language. If we don’t teach people this it leads to some weird edge conditions internal to commonmark.