You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing, make sure to use hexo server -s combined with hexo generate to serve the static content, otherwise it looks like loadAllLanguages is called and the issue does not happen.
That being said, I doubt that there's much that hexo can do besides systematically load all languages.
The workaround right now would be to leave out the language from the code block and set highlight.autoDetect: true in your config file.
Another possible workaround could be to have a hidden/draft post that has an empty code block for each language that you will use. This should force the generator to require those languages, and then you shouldn't have any problems in the actual post.
Hello,
The lazy loading behavior in
lib/highlight.js
introduced in 7f6469e may break some languages highlighting such asshell
.The
shell
language highlighting relies on thebash
language, ifbash
language is not registered yet, you will get an unexpected highlighting result.Input:
Expected result:
'<span class="meta">$</span><span class="bash"> <span class="built_in">echo</span> <span class="string">"Hello World"</span></span>'
Only
shell
is registered:'<span class="meta">$</span> echo "Hello World"'
The text was updated successfully, but these errors were encountered: