I'm quite puzzled how the syntax highlighting feature here on SO works, but I have seen similar somewhere else. How does this work?
And if one of these is true, how does it work?
Check out Javascript code prettifier on Google Code.