public static void SetHtmlFontStyle(this HtmlElement element, System.Windows.FontStyle fontStyle, HtmlValueConverter converter) { if (fontStyle == System.Windows.FontStyle.Normal) { element.ClearHtmlStyleProperty("font-style"); } else { element.SetHtmlStyleProperty("font-style", converter.ToFontStyleString(fontStyle)); } }