isagalaev/highlight.js — pull request #612 by treshugart (2014-10-21 06:36:05+00:00)
Title: Simplify exporting of window / amd / cjs.

If your build process wraps the source in an IIFE that gets executed with a modified context then Highlight won't work at all. You could invoke the IIFE with `window`, but that becomes difficult when using something like Traceur where you don't have control over that without having to hack something pretty ugly into your build process.

I've also simplified how the exporting is done. The `global` variable isn't used at all within the `factory()` and it's not used for the CommonJS exporting; it's only used for exporting to the `window` which is `this` when running in a browser context unless the aforementioned happens.

You have both a `src/test.html` file and `tests/index.html` and I'm not really sure how you intend them to be used for testing. I've implemented something with it in a browser context and ran the code through node and everything seems fine.