I have now put together a bundle that will enable you to export selected text as either HTML or XHTML. It uses the source-highlight utility that Xavier pointed out. It's not foolproof though. A single quote in a commented line in a Perl document screwed up the result in one test, but there's nothing I can do about that.
This is my first attempt at a TM bundle, so go easy on me. Try it out and let me know if it works. I've tested it with C, C++, Perl, PHP and Ruby files and except for the above mentioned mistake, everything worked.
Thanks to Allan, Eric and Xavier for their help.
You can get it here:
www.chrisruzin.net/sh.tmbundle.tgz
- Chris