Syntax highlighting not working as promised

Everywhere I look it says that “Syntax highlighting on GitHub Pages works the same way it does on GitHub” which is true for some languages but not for all.

For example here: https://github.com/arma3/arma3.github.io/blob/master/index.md
All the examples work as expected. Note here the SQF highlight that correctly highlights the SQF command (getPos) vs the variable (SQFplayer).

However if you look at the final page http://sqf.ovh/ (we use a special stylesheet for JS syntax. But it cannot differentiate between variable and command)

You’ll see that JS and CPP highlights are working in that they are highlighting something. However the SQF highlight is just blank.

Github says syntax highlighting works the same as on Github itself, but it doesn’t seem to be like that.

Any advice on what I should do? Do I need to add the language to Rogue and Pygments manually although Github already says it should work?

I just found https://github.com/jneen/rouge/pull/761 but it still seems wrong that Github says it should work the same while it actually doesn’t.

You’re right that the documentation could probably be a little more specific but what it means when it says “syntax highlighting works the same as on GitHub” is that you can use fenced code blocks in the same way on GitHub Pages as you can on GitHub. The syntax highlighting itself relies on the Rouge library and, as you pointed out, Rouge itself does not yet support SQF.

Sorry for the confusion. I’ve given the feedback to the documentation team.

1 Like