private static string GetDescriptionAsRawHtml(DiagnosticDescriptor diagnostic)
{
StringBuilder sb = new StringBuilder();
bool hasDescription = false;
string details = diagnostic.Description.ToString(CultureInfo.CurrentCulture);
if (!String.IsNullOrWhiteSpace(details))
{
sb.AppendLine("<p>" + details + "</p>");
hasDescription = true;
}
if (!String.IsNullOrWhiteSpace(diagnostic.HelpLinkUri))
{
sb.AppendLine("<h2>" + UIResources.RuleGen_MoreDetailsTitle + "</h2>");
sb.AppendLine(String.Format(UIResources.RuleGen_ForMoreDetailsLink, diagnostic.HelpLinkUri));
hasDescription = true;
}
if (!hasDescription)
{
return UIResources.RuleGen_NoDescription;
}
return sb.ToString();
}