Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight.js not working for language-tex #954

Closed
adigitoleo opened this issue Apr 29, 2022 · 2 comments
Closed

highlight.js not working for language-tex #954

adigitoleo opened this issue Apr 29, 2022 · 2 comments

Comments

@adigitoleo
Copy link

adigitoleo commented Apr 29, 2022

I can't get latex code blocks to be highlighted using highlight.js, despite upstream claiming to provide support. Tried with both v10 and v11 of highlight.js.

I'll see if I can repro using one of the simple templates soon. Does it work for anyone else?

I should mention: other languages like python, julia work fine.

@tlienart
Copy link
Owner

What I did:

  1. get a latest bundle that has LaTeX in it using this webpage: https://highlightjs.org/download/ ; put the languages/ folder and highlight.min.js in libs/highlight/
  2. in the page foot modify the call to highlight to
<script src="/libs/highlight/highlight.min.js"></script>
<script>hljs.highlightAll();</script>

(for me this was in _layout/foot_highlight.html)

result:

Screenshot 2022-04-29 at 09 51 47

PS: you'll likely want to disable pre-rendering as that might not work with the latest version of highlight (I haven't tried but in any case the pre-rendering stuff in Franklin will be deprecated)

@adigitoleo
Copy link
Author

Done, works! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants