Skip to main content

Code syntax highlighting in BlogEngine.Net

·80 words·1 min
 Author
Author
Sam McGeown
Steely-eyed missile man
Warning: This article is now 18 years old! It is highly likely that this information is out of date and the author will have completely forgotten about it. Please take care when following any guidance to ensure you have up-to-date recommendations.

I’ve just added some code syntax highlighting to this blog using SyntaxHighlighter and a great how-to article by Scott Dougherty this means that any code I post should look like this:

public static string SayHello(string name){    return String.Format("Hello, {0}!", name);}

There are a few bugs at the moment, one being that tiny_mce is stripping linebreaks from the code posting (just a minor one) and the theme somehow removes the line numbers, but I’m sure I’ll find a way around them…somehow.