Attempted to create an example for bash and shell highlighting, but the latest version does not show any colors (grey background with black text): http://plnkr.co/edit/smWejiNw2dNd5QjrmZzm?p=preview
However, the highlight.js website shows colors somehow??
Hi @ericis,
add the following
<script>hljs.initHighlightingOnLoad();</script>
after loading highlight.min.js.
Also some points:
bash.min.js and shell.min.js as both of them are contained in highlight.min.js.hljs class; <pre><code class='bash'> is just fine.$), choose shell class. Otherwise, choose bash.I'm closing this as there was no reply. Feel free to reopen in case something left unanswered.
For reference I actually had to load the shell language, in order to access the feature.
Highlight JS 10.1.1
"shell" is definitely included in the latest CDN builds:
https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js
Yes but I needed to load the language as well in order to have shell highlighting to kick in, maybe there's somthing wrong in my setup. Byt this goes over my competences in JS.
I don't see why that would be. Bash and Shell are both included in the default/common build - unless you're using a custom build without them. If you can reproduce a standalone jsfiddle that shows you issue you can file an issue and I'd be happy to take a look.
@yyyc514 I'll see what I can come up with tomorrow.
For simple tests you can fork https://jsfiddle.net/ajoshguy/2bmdswn6/4/
@yyyc514 It turns out I could not reproduce ; maybe I was too tired. After investigating... well indeed shell language works with the default build. It was a hugo template error in the theme. Thank you for the patience. I understand what it is to maintain an opensource project.
Cheers !