public static string Filter(string html, HtmlProfile profile) { if (string.IsNullOrWhiteSpace(html)) { return(string.Empty); } using (var htmlReader = new HtmlReader(html)) { using (var stringWriter = new StringWriter()) { using (var xmlWriter = XmlWriter.Create(stringWriter, DefaultXmlWriterSettings)) { Filter(htmlReader, xmlWriter, profile); } return(stringWriter.ToString()); } } }
public static string Filter(string html, HtmlProfile profile) { if (string.IsNullOrWhiteSpace(html)) { return string.Empty; } using (var htmlReader = new HtmlReader(html)) { using (var stringWriter = new StringWriter()) { using (var xmlWriter = XmlWriter.Create(stringWriter, DefaultXmlWriterSettings)) { Filter(htmlReader, xmlWriter, profile); } return stringWriter.ToString(); } } }