//
you're reading...
.NET 1.x

SyntaxHighlighter for .NET problems fixed

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.

Download links follow:
SyntaxHighlighter.zip – Demo application (10KB)
SyntaxHighlighter_src.zip – Source code (15KB)

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.

Advertisements

About James

I am a Senior Developer/Consultant for InfoPlanIT, LLC. I previously spent over 7 years as a Product Manager for what eventually became ComponentOne, a division of GrapeCity. While there, I helped to create ActiveReports 7, GrapeCity ActiveAnalysis, and Data Dynamics Reports.

Discussion

2 thoughts on “SyntaxHighlighter for .NET problems fixed

  1. I haven’t uploaded the updated site yet – but it works okay on my local copy 🙂

    Great stuff, Jambo!

    Posted by Nish | July 13, 2005, 7:04 am

Trackbacks/Pingbacks

  1. Pingback: void Nish(char* szBlog);»Blog Archive » Mr .NET colorized my articles! - July 14, 2005

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archive

%d bloggers like this: