Goldmark codefences results in pre+code

When using Goldmark processor and you add some codefences to a markdown file.
This results in an output that is <pre class="language-foo"><code class="language-foo">
Is there any way to tweak this, so it doesn’t output both, or completely skips some specific language?

TLDR; I’m trying to use Mermaid.js together with my Hugo generated site, but the above prevents this

No, there is not.

But have a look at this: