HTML to text

Posted by Joe Enos on August 18, 2021 · 1 min read

Install-Package NUglify

public static IHtmlContent HtmlToText<T>(this IHtmlHelper<T> html, string htmlText)
=> new StringHtmlContent(Uglify.HtmlToText($"<div>{htmlText}</div>").ToString());