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.

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

Answered 4 months ago · Improve this answer

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

Answered 3 months ago · Improve this answer

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

Answered 3 months ago · Improve this answer

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

Answered 3 months ago · Improve this answer

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.

Answered 3 months ago · Improve this answer

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!

Answered 3 months ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 28 questions bug 14 questions posts 9 questions resolved 7 questions request 6 questions google-drive 5 questions configure 4 questions pages 3 questions added 3 questions meta 3 questions More tags →
Subscribe for changes
RSS Feed of latest questions