Open fabricepallaud opened 9 months ago
What languages do you usually see getting chosen?
@joshgoebel Javascript and HTML (ideally Vue component too but I don't think that package supports that).
Maybe add some debugging to output the value of hljs.listLanguages()
and see what that returns just to confirm you're loading them all.
Thanks, yep I just console logged that and they do appear to load fine:
I ran into the same problem
The solution is to pass :autodetect="false"
and the language you would like to use language="python"
I found the solution by reading the source code for 1 minute 🤣
It looks to me (reading source) that setting language should override the autodetect prop, am I missing something?
Whether I call the plugin directly from my template section or mount it programmatically and passing to it a language prop value, the language I specify always ends up being ignored by the plugin who instead chooses himself a language.
From template section:
<highlightjs language='javascript' code="var x = 5;" />
From script section (programmatically):
Here's how the plugin is imported in my main.js: