Please support syntax highlighting when embedding source code in Markdown. The syntax for it seems supported, but no highlighting happens:

```java
public class Example { }
```

Also, we often require students to refer to particular lines of a piece of code in an assignment. Right now, we add line numbers by hand. It would be awesome if we could somehow get line numbers near code blocks automatically.

Submitted by Robbert Krebbers on 9 February 2017 at 14:19

On 9 February 2017 at 14:22 Elmer van Chastelet commented:

Funny that you added this issue just now, as I just added syntax highlighting for markdown code blocks, ready for next release (within a week).
I haven’t enabled line numbers, but I can also add this option.


On 9 February 2017 at 14:22 Elmer van Chastelet tagged 0.47.5

On 9 February 2017 at 14:24 Robbert Krebbers commented:

Awesome, that’s great timing :).

Does Markdown have syntax to let the user decide whether he/she wants line numbers?


On 9 February 2017 at 14:31 Elmer van Chastelet commented:

It is possible to add that (it’s not part of any markdown spec that I’m aware of ), but this would take more time. Not urgent enough for me, so let’s just add line numbers, instead of making this optional.


On 9 February 2017 at 14:31 Elmer van Chastelet closed this issue.

On 9 February 2017 at 15:23 Robbert Krebbers commented:

Alright, just to be sure, I will only get line numbers when I specify a language? So, when I use

 ```java

but not when I use just

```

?

Getting line numbers in the latter would be confusing, as we already have hardcoded line numbers for many existing code snippets.


On 9 February 2017 at 15:31 Elmer van Chastelet commented:

Yep, no language = no line numbers.

Log in to post comments