5
$\begingroup$

I've noticed that there seem to be issues with the syntax highlighting.

Take this recent post as an example:

screenshot of example

Clearly, the question is tagged . Thus, R syntax highlighting should be applied. However, it isn't. You can easily see that because comments (starting with #) should be grey. I suspect a default (C?) highlighting is applied. The strange thing is that in some posts correct syntax highlighting is used (example) and in some not.

Here is a screenshot from Stack Overflow showing the correct syntax highlighting:

screenshot from post rendered at Stack Overflow

$\endgroup$
4
  • 1
    $\begingroup$ Even adding <!-- lang-all: lang-r --> doesn't seem to work :-(. $\endgroup$ Oct 19 at 11:32
  • 1
    $\begingroup$ It's a bug, probably not only related to CrossValidated.com, but likely also other sites, so I'm moving it to the Meta site. $\endgroup$
    – Tim Mod
    Oct 19 at 12:54
  • 2
    $\begingroup$ @Tim you can fix it yourself, at the bottom of this page. On SO, the setting is correct: stackoverflow.com/tags/r/info $\endgroup$
    – Glorfindel
    Oct 19 at 13:00
  • 1
    $\begingroup$ @Glorfindel thanks, I wasn't aware of this setting. $\endgroup$
    – Tim Mod
    Oct 19 at 13:06
9
$\begingroup$

I learned something new today. Apparently the tag wiki pages have default syntax highlighting setting on the bottom and we used the default one for the [r] tag (for Python it is correct).

Now it's fixed.

enter image description here

Alternatively, remember that you can always use

<!-- lang-all: lang-r -->

somewhere in the body of the post to set highlighting for all snippets, or start the snippet with

```lang-r
$\endgroup$
2
  • 3
    $\begingroup$ I wonder how it got changed. The setting for the [r] tag used to be correct. Also, I tried <!-- lang-all: lang-r --> on the linked page & it didn't turn on the correct syntax highlighting, but I spent very little time on it. $\endgroup$ Oct 20 at 11:19
  • $\begingroup$ @gung-ReinstateMonica unfortunately I have no idea as well. $\endgroup$
    – Tim Mod
    Oct 20 at 11:48

You must log in to answer this question.

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