Skip to content

Instantly share code, notes, and snippets.

@congdanhqx-zz
Created September 4, 2013 17:17
Show Gist options
  • Save congdanhqx-zz/6439972 to your computer and use it in GitHub Desktop.
Save congdanhqx-zz/6439972 to your computer and use it in GitHub Desktop.
test2
[Extension("This extension enables Github Gist support for BlogEngine.NET.", "1.0", "Cong Danh")]
public class GistExtension
{
public GistExtension()
{
Post.Serving += Post_Serving;
}
void Post_Serving(object sender, ServingEventArgs e)
{
e.Body = Regex.Replace(e.Body, "\\[gist\\s[^\\]]*id=(\\d+)[^\\]]*\\]","<script src=\"https://gist.github.com/$1.js\"></script>");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment