I’m trying to use highlight.js to highlight some powershell code using markdown code fences. I’m having trouble getting highlight.js to recognize it (ironically discourse seems to recognize it). For example:
```powershell
echo "Profile loaded from $profile"
```
If I do it the long way then it works:
<pre><code class="powershell">
echo "Profile loaded from $profile"
</code></pre>
I think this is happening because the generated code block has the wrong class <pre><code class="language-powershell"> so I’m not sure what I’m doing wrong.
You shouldn’t have a problem using highlight.js with the fenced code blocks created by BlackFriday, although if you’re having an issue with the markdown renderer, I would recommend posting an issue on BlackFriday’s repo on GitHub. As far as the difference in classes, have you checked to see whether the classes are modified on the client by highlight.js itself? Just a thought. Otherwise, I would need to see more code and any errors you might be getting in the browser console. Keep in mind that you’ll also need to import/use the highlight.js css as well…
I’m personally a fan of prism.js as well. You can add Powershell from the site’s download. I went with prism because of the additional plugins, especially line numbers. FWIW.