The code in my answer over at Stack Overflow highlights very strangely:
I discovered this at Stack Overflow, but it affects just as much all other Stack Exchange sites with highlighting enabled (I checked Code Review and Electrical Engineering). I don’t know if this is specific to JavaScript or affects anything else; I remember something similar happening before, but this is the only test case I have got at the ready.
Note that when using the latest version of Highlight.js (11.5.1), this does not happen:

So this is matter of outdated third party tool used by Stack Exchange to highlight code (version 11.0.1).