Blot

Syntax Highlighting

Can you see any reason why the Syntax Highlighting for the Javascript section in this post isn't showing? It appears to be trying to load the colors according to the HTML when I inspect the element, but none of the syntax colors are working.

They were working earlier this evening.

Asked 4 years ago Edit
6 replies

It looks like you removed the CSS required? The HTML output looks correct, it seems like the syntax highlighter plugin is behaving as expected

4 years ago Edit

I've tried copying and pasting the original CSS in from another template, but no luck.

4 years ago Edit

Look for the ‘.hljs’ CSS and make sure that is present in your custom template’s CSS file

4 years ago Edit

Yep, copied directly from the Blog template's CSS:

But it's not pulling in that formatting: https://heydingus.net/blog/2021/11/writing-my-first-script

4 years ago Edit

There's likely a syntax issue with your CSS or template code elsewhere in that file which is tanking the .hljs styles – I've confirmed that although the text string for the required CSS is present in style.css, per my browser's developer tools the styles themselves were not parsed. When I moved the hljs styles to the top of style.css for you, they are now parsed correctly which further supports this assumption.

4 years ago Edit

Hmm, I guess I’ll need to do some spelunking to try to figure out what I messed up. But thanks for the move-to-top fix!

4 years ago Edit

Your reply