Update: I should have proofread this first…my original intent was to just post about the problems; but after writing about them I decided to pack up a new release but I didn’t change the text to acknowledge that.
Looking back at the previous post I noticed I wasn’t very clear in how to use it. And I’ve also squashed some killer bugs with a ton of help from Nish.
In particular, it would ignore the language specification in a pre block unless the language is in quotes (“”); breaking compatibility with the PHP version. There were also a couple bugs dealing with how comments were handled; one was a simple copy/paste error on my part where instead of looking for block comments it looked for line comments again. The other is more sinister in that the sorting routines between PHP and .NET differ enough that the same same sorting routine will work fine in PHP but cause an infinite loop in .NET.
Both are now fixed.
The demo application has been cleaned up a bit; and the base code is now more forgiving of multiple language registrations and handling unregistered languages.
To use the demo application put the files you want to highlight into a directory with a “.src” extension. Run the ConsoleDemo.exe program with the directory name as the only paramter (or set your current directory to the same place the source files are and run it). The highlighted versions will be written out with the same name, but with a “.html” extension.
Once its done it will spit out some very basic stats: the number of bytes output, total time taken, and average time taken.
Nish is starting to use this on his regular website now so as long as it doesn’t completely thrash his site my next goal is going to be the ASP.NET control.