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

Bump Highlightjs version and change how it's loaded #12

Closed
JTinkers opened this issue Aug 15, 2020 · 4 comments · Fixed by #15
Closed

Bump Highlightjs version and change how it's loaded #12

JTinkers opened this issue Aug 15, 2020 · 4 comments · Fixed by #15

Comments

@JTinkers
Copy link

Right now it uses an outdated version and imports all languages by default.
This makes whole plugin pack a whopping 1.04 MB.

https://i.imgur.com/9AGcONT.png

@valeriangalliat
Copy link
Owner

Hey! I just merged a PR that updates highlight.js, I published markdown-it-highlightjs@3.3.0 with that

How would you go to prevent importing all languages by default? Does highlight.js support anything like this?

@JTinkers
Copy link
Author

Yes, it allows you to either autoload all or selected ones.

https://highlightjs.readthedocs.io/en/latest/api.html#configure-options - the languages field in configure(options)

@valeriangalliat
Copy link
Owner

Oh makes sense

Since those are global highlight.js options, you should be able to do require('highlight.js').configure({ languages: [...] }) before calling markdown-it-highlightjs! Let me know if that works :)

@JTinkers
Copy link
Author

Yeah, I've just forked and modified your package few months ago.

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