I transfer my Code Highlight CSMdoule to BlogEngine.Net extension. There is a very easy wrote a extension on BE.Net
Just change a few code for BE.Net
1
2
3
4
5
6
7
8
9
10
|
public CodeHighlightExtension()
{
Page.Serving += new EventHandler<ServingEventArgs>(ServingContent);
Post.Serving += new EventHandler<ServingEventArgs>(ServingContent);
}
private void ServingContent(object sender, ServingEventArgs e)
{
e.Body = SourceCodeMarkup(e.Body);
} |
And on BE , line break have some different communityserver , so i
convert "<br />\r\n" to "\n" and add default format style in code.
If you don't want change default style , will no needs modify web.config .
It's test on BlogEngine.Net 1.4.5.0 .
Project page : http://update.to/be/codehighlight/
Download : http://update.to/be/codehighlight/CodeHighlight_10.zip