Rich text editor converts bbcode into display math

It seems that my system injects a <pre><code> for the clipboard…

> arguments[0].clipboardData.getData('text/html')
'<pre><code class="lang-plaintext hljs language-plaintext" data-highlighted="yes">[details="summary"]
some text
[/details]
</code></pre>' 

Anyway, the main point is that what you see in the wysiwyg editor is not what you get.