public static void WriteLink(HtmlTextWriter writer, Topic topic)
{
if (string.IsNullOrWhiteSpace(topic.Body))
{
writer.Write(topic.Name);
}
else
{
var path = LinkHelper.GetLink(topic);
writer.AddAttribute(HtmlTextWriterAttribute.Href, path);
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.Write(topic.Name);
writer.RenderEndTag();
}
}