I tried several ways of how to do syntax highlighting for R in this question, but it doesn't work. I tried ```R (see revision 3 of the question) and <!-- language: R --> (see revision 2) but neither of them does work, despite the instructions in Syntax highlighting language hints.

PS: note that I don't want to tag the question with the R tag because it is not R specific.


1 Answer 1


I've just submitted a suggested edit using the old-style code blocks and a language hint:

<!-- language: lang-r -->

That seems to work:

enter image description here

Your last version (revision 3) might not work since you used a capital R; language hints need to be in lower case.

  • 3
    Thanks! These are really catches! lang-r instead of just R! And small r instead of R - R is always written with capital R. I think the documentation needs update with list of possibilities and maybe the parser could be more tolerant as well.
    – Tomas
    Nov 29, 2019 at 12:05
  • It looks like it registers both upper- and lower-case varients. In theory it should work but I guess there's something else in the way.
    – OrangeDog
    Nov 29, 2019 at 17:02
  • @Tomas the list of possibilities is in the linked Prettify documentation.
    – OrangeDog
    Nov 29, 2019 at 17:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .