Here is the code being used as and Extension to render code.
The format is
1:
#region using
3:
using System;using System.IO;using System.Web;using System.Text.RegularExpressions;using BlogEngine.Core;using BlogEngine.Core.Web;using CodeFormatter;
#endregion
5:
/// <summary>/// </summary>/// <remarks>/// It is a work in progress...../// </remarks>[Extension("Changes <code:lang></code>. Adapted from Jean-Claude Manoli [jc@manoli.net].", "0.0.0.1", "www.manoli.net")]public class CodeFormatters{
private enum CodeLanguages { csharp, vb, js, html, xml, tsql, msh }
7:
public CodeFormatters() { Post.Serving += new EventHandler<ServingEventArgs>(Post_Serving); }
void Post_Serving(object sender, ServingEventArgs e) { /* It supports the following. * C# * VB * JS * HTML * XML * T-SQL * MSH (code name Monad) --I don't have a clue. */ if (!string.IsNullOrEmpty(e.Body)) { e.Body = _CSharpRegex.Replace(e.Body, new MatchEvaluator(MatchEval)); e.Body = _VBRegex.Replace(e.Body, new MatchEvaluator(MatchEval)); } }
9:
}
Related posts
Comments
Add comment