Syntax highlighting on windows
See original GitHub issueReferring back to #7, we ended up disabling syntax highlighting on Windows. This was a bi-product of correcting some exceptions.
It’s still not clear why syntax highlighting is no longer working on Windows. If someone could track it down, it would be great!
How syntax highlighting works
We use hljs (highlight.js) which we include in all the code which is pushed into PhantomJS (headless browser). This should action syntax highlighting and it does in the debug HTML output, however for some reason under PhantomJS it’s not rendering out the highlights in the final PDF save.
PhantomJS is a headless browser wrapped into a node module, it’s used within the html-pdf
package we use. It enables us to kick up a browser, push in the html, and get a PDF out afterwards as well as having some header and footer support we make use of.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@BlueHatbRit Hey! I’m really happy to see you’re using
showdown-emoji
which I have just open-sourced and published it (it was onnpm
for a while but it wasn’t on GitHub).Also, I open-sourced
showdown-highlight
which useshighlight.js
.I think that will help since it will generate the highlighting on the server, not on the client. Once added,
showdown-highlight
will convert the code blocks (pre
) into highlighted code blocks. That means we still need the highlight.js CSS, but not the JavaScript on the client.I don’t have a Windows machine around…
Keep up the good work! 👍
This should be resolved with the 2.0.0 Puppeteer based release but please check the release notes before upgrading!