don't parse null strings as md

This commit is contained in:
Michael 2017-04-22 21:37:23 -04:00
parent bc56237435
commit 3e98bc2e52

View file

@ -121,6 +121,8 @@ public static string ResolveUserLinksInMarkdown(string mkdn)
public static IHtmlString Markdown(this HtmlHelper hpr, string md)
{
if (md == null)
return hpr.Raw("");
md = ResolveUserLinksInMarkdown(md);
return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md)));
}