Client-Side code highlighting

When I visited Alex Gorbatchev's blog, I noticed he had a unique client-side code highlighting solution in place, one I hadn't seen anywhere else. That's something I've wanted on my blog for a while; the vanilla <PRE> sections I've been using are servicable, but primitive. Although I loves me some regex, I don't know squat about PERL so I've been hesitant to hack anything fancier into my Movable Type install.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/01/client-side-code-highlighting.html

Alex and I are currently… uh… wrangling with the fact that there isn’t an .innerText property on elements in Mozilla/Firefix.

There is an .innerHTML property, but there are some bizarre ramifications when the “HTML” has escaped markup inside of it. It’s more subtle (buggy?) than you might think.

More details in the comments at his blog:

http://blog.dreamprojections.com/archive/2005/01/01/461.aspx

Just a heads up :slight_smile: new version 1.0.4 is out

This is now in Google’s code repository.

http://code.google.com/p/syntaxhighlighter/

Gee, great thing we got that all figured out, right?

…right? :stuck_out_tongue: