Meta: with JavaScript disabled (or if it fails to load), your <code> elements are very badly styled because of the highlighter-rouge class on them, which per monokai.css makes them `display: block` (and other related styles designed only for blocks of code, not inline code). When the JavaScript runs, the rouge highlighting is undone by https://thatgeoguy.ca/js/prettifyCode.js, which clobbers the class attribute, seemingly by accident (the comment says it’s adding, but it’s replacing instead) or incomplete modification… thereby apparently inadvertently fixing the problem!
The ideal solution is probably either removing the rouge highlighter from inline code elements, or shuffling the only-for-blocks .highlighter-rouge styles in monokai.css to a new rule div.highlighter-rouge, since they’re not suitable for inline code elements.
(I’m mentioning this here because the author is actively involved in the thread and thus there’s a reasonable chance of it being fixed.)
I'm not a web developer by trade, so this is good advice and something I never looked into. Thanks for the heads up, I'll have to block Javascript and see if I can get it working. I might be able to remove the prettify stuff entirely.
The funny thing there is that prettifyCode.js looks to be attempting to set the scene for a client-side highlighter, but no such highlighter is then used. And you’ve already got server-side highlighting happening.
Yeah, this is very likely an artefact of switching my blog from Django to Jekyll years ago, and then adopting rouge years after that. I definitely would like to use less JS on my website, and like you said, I already have server-side highlighting.
The ideal solution is probably either removing the rouge highlighter from inline code elements, or shuffling the only-for-blocks .highlighter-rouge styles in monokai.css to a new rule div.highlighter-rouge, since they’re not suitable for inline code elements.
(I’m mentioning this here because the author is actively involved in the thread and thus there’s a reasonable chance of it being fixed.)