With no default language set, code fences don't pass their info string to the generated markup

I can’t find a way to simply pass the code fence info string to the generated markup, when it specifies a language that is not listed for syntax highlighting:

  • If I use nohighlight for the default code fence language, it ignores the info string and generates class="lang-nohighlight".
  • If I use auto for the default code fence language, it ignores the info string and tries to guess the content, e.g. generating class="lang-swift" for ```plantuml.
  • If I unset the default code fence language (set it to empty), at least my language isn’t replaced with anything, but it also nowhere to be found in the generated markup.

Coming from the remark / prismjs ecosystem, I would expect the language I put in the code fence info string to be preserved in the markup, even when not processed and styled by highlightjs, e.g. like <pre><code data-lang="plantuml">…</code></pre>.

1 Like