BloomTemp.TempFileUtils.CleanupHtml5 C# (CSharp) Method

CleanupHtml5() public static method

public static CleanupHtml5 ( string xhtml ) : string
xhtml string
return string
        public static string CleanupHtml5(string xhtml)
        {
            var re = new Regex("<(title|div|i|table|td|span|style) ([^<]*)/>");
            xhtml = re.Replace(xhtml, "<$1 $2></$1>");
            //now insert the non-xml-ish <!doctype html>
            return string.Format("<!DOCTYPE html>{0}{1}", Environment.NewLine, xhtml);
        }