CSharp syntax coloring broken?


(Uwe Keim) #1

I’m using the syntax

```csharp
// Here goes my code.
```

To syntax color my code snippets.

This worked until recently.

My question:

Is my asumption correct? If yes, how can I fix it?


(Jeff Atwood) #2

I know @sam changed this around so you can specify exactly which languages can be highlighted, perhaps csharp is not one of the defaults and must be specified in site settings now?


(Uwe Keim) #3

That did the trick!

Seem what formerly worked as csharp is now known as cs.

After I changed this in my posting, my code snippet is colored correctly again.

Will try to change all my postings now… :no_mouth:


(Sam Saffron) #4

The hint is called

```cs
code here
```

per:

It is enabled by default.

If you omit it highlight js does a pretty fine job guessing, unless you are tricking it

if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
```sql
if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
```

```cs
if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
```

```
if (bob == "test") {
   // SELECT * FROM table LIMIT 10
   System.WriteLine("HI");
}
```

(Régis Hanol) #5