Some languages (for example "html, js") are skipped in the code block snippet, because – in this case – "html" or "js" are not included in the array returned by the Highlighter method listRegisteredLanguages(). "js" is the default value for JavaScript in the code block blueprint. The result is that the language is marked as "plaintext" which is not what we want.
There are two ways to fix this:
Remove the if-statement in the block snippet
Update the method listRegisteredLanguages() include the missing languages
Quick update on this:
I've looked into the highlight.js class and and saw that the listRegisteredLanguages() method can return the languages with aliases passing a boolean param. So just update the code block snippet with listRegisteredLanguages(true) and we are fine.
Some languages (for example "html, js") are skipped in the code block snippet, because – in this case – "html" or "js" are not included in the array returned by the Highlighter method
listRegisteredLanguages()
. "js" is the default value for JavaScript in the code block blueprint. The result is that the language is marked as "plaintext" which is not what we want.There are two ways to fix this:
listRegisteredLanguages()
include the missing languagesQuick update on this: I've looked into the highlight.js class and and saw that the
listRegisteredLanguages()
method can return the languages with aliases passing a boolean param. So just update the code block snippet withlistRegisteredLanguages(true)
and we are fine.