Welcome! Please see the About page for a little more info on how this works.

0 votes
in Meta by

The syntax highlighting for code blocks on this site is a bit broken / inadequate. If you look at the code blocks in a recent question of mine, you can see it pretty randomly applies colors, to the point of making some things very hard to read because it apparently considers # to be comment syntax.

By inspecting the DOM, I noticed that the system tries to guess at the language in the snippet and then applies syntax highlighting rules for whatever it guessed. It wrongly guessed cs, php and ruby for various code blocks in my question, so either the algorithm is pretty bad or Clojure isn't even supported.

Is there perhaps a way to specify which syntax highlighting to apply a la fenced code blocks in GFM I couldn't find? If not, I suggest to generally disable syntax highlighting if possible.

1 Answer

0 votes
by

I did try a GFM plugin for the platform (question2answer) when we put the site together but it was pretty broken. I'd love to do so, and it's entirely possible such a thing exists but this is the kind of infrastructure work we rarely get around to.

by
I see! Yeah I feel you with regards to this kind of work. FWIW, I think disabling syntax highlighting completely would also be an improvement already over the status quo, so if that's easier to do ...
...