How to color syntax in a post?

In some of the threads on this discourse, I’ve seen people post code snippets with colored syntax which makes the code a tad easier to read.

I’ve tried using the same <!-- language : lang-js --> type syntax found on SO but that doesn’t seem to work.

Is there any documentation on how to enable code snippet syntax highliting in the Aurelia discourse?

1 Like

Haven’t noticed that before but it seems like wrapping text in ``` does some formatting

Doublequotes color me "red"

I have no idea, why that first word is greenish…

1 Like

Hmm, I can’t seem to get it to work. Are you stating that just wrapping text in ``` does the trick? IOW [backtick][backtick][backtick]my text[backtick][backtick][backtick]?

this is what i get

Just realized that the ``` have to be on their own line:

<div class="myclass"></div>

If on the same line you get this:

<div class="myclass"></div>

1 Like