Here's why it's happening:
We're using TextMate syntax bundles, which require the Oniguruma regexp engine, which only has partial pure-JavaScript implementations that can run in the browser. We use https://github.com/bcoe/onigurumajs, which is great. We think something in this stack is producing different results than using C-based Oniguruma, and we'll work on it.
The good news is that we'll open-source whatever improvements we do make, so other folks building web-based syntax highlighting components will benefit.