Coding in replies

So if you want to put some code from a coding language like Python or Java, you can do this:

```langname
<code>
```

For Python Code:
```python

print("Hello World!")

```

For Javascript code:
```javascript

alert("Hello World!");

```
Every single letter or character of code is in the same color. So I guess it doesn't work. Please vote if I should delete it or not. (it does work, check parentheses and semicolon)

For C# code:

```c#

string String = "Hello World!";
Console.WriteLine(String);

```
I don't know if this is supposed to happen, so I guess it's safe to say that it is sort of a success.
(also correct me if I'm wrong, but can't you just do Console.WriteLine("Hello World!");?)

For Java code:
```java

System.out.println("Hello World!");

```

For C++ (or C) code: (someone who actually knows this please edit, as neither c nor c++ work)
```

#include <stdio.h>
int main(){
   printf("Hello World!");
   return 0;
}

```
The simple Hello World program but made tricky. Why did you have to do that, C developers...

For HTML/XML:
```html

<html>
    <head></head>
    <body>
        Hello World!
    </body>
</html>

```

```xml

<list>
    <item type="text">Hello World!</item>
    <item type="text">this can be anything really because how xml is interpreted varies widely</item>
</list>

```
HTML and XML seem to be displayed identically--if anyone can find a counterexample do let me know.

Those are the only ones I know. Feel free to experiment tell me.

I put all the code into preformatted text because the

```[CODING LANGUAGE NAME]

bits would disappear.

##See? Now the "Python" bit has disappeared.
print("I can still write code and the reply will automatically")
print("color it.")

Also you can :upside_down_face:

a = "snap"
print(a)

Your examples don't clarify that you also need a line with (nothing but) ``` at the end.

I can't really add another ``` at the end, it won't show even with preformatted text on.

```text
You're right

Fine, but anyone who reads your tutorial needs to know that they're needed!

foo bar
`​`​`
```​
this is my code
```​

I was so confused for a long time, until I found out you stuck in an invisible character here

```​
this is my code
```​
   ^

You're looking at a new line character. They did it like this:

image

it's actually an invisible character, just look
image

This is not including the newline character. Here it is with the newline character

also,
untitled script pic (15)
untitled script pic (16)
untitled script pic (18)

as well as

```
Fun fact:
Just like with many programming languages,
Discourse uses \ for escaping characters.
```

\```
Fun fact:
Just like with many programming languages,
Discourse uses \ for escaping characters.
\```

I just fixed that.

There's also text for no formatting:

```text
nothing here is formatted:
//moew
no comment formatting #mnbvcxzaqsewdfrgthuyjiklop
`​`​`

Java is not an acronym, therefore it should not be capitalized.

bool coolPost = true;

void prettyNeat(int idSay)
{
    dontYouAgree();
}

Well it normally is...

I meant that Java should not be written in all caps.

Python and

Javascript and

JAVA doesn't work...don't know why.