Autolab
Autolab copied to clipboard
No syntax highlighting for multiple line comments
The comment on lines 2 and 3 is black instead of green
Issue has been around for a while (including on prod!) but for some reason no one quite attended to it
Incorrect syntax highlighting physically hurts my eyes 😢 - Oliver
Unfortunately, updating to the last version of highlight.js (v11.7.0) doesn't seem to fix it.
Style does change slightly though:
On second thoughts, it's probably because of this code in annotations.js
// Add syntax highlighting to the new code viewer
$('pre code').each(function () {
hljs.highlightBlock(this);
});
I think oliver had a wip branch speedgrader-syntax-fix
, it might be worth further investigation
It's mainly because the syntax highlighting is done line by line instead of the whole file
Could consider using https://github.com/wcoder/highlightjs-line-numbers.js