/// <summary> /// 格式化Html /// </summary> /// <param name="xmldoc"></param> /// <returns></returns> public static Dictionary <string, string> HtmlFormat(XmlDocument xmldoc) { var resultDic = new Dictionary <string, string>(); string input = HttpUtility.UrlDecode(GetNodeInnerText(xmldoc, "input")); string result = HtmlFormater.FormatHtml(input, true); string status = result.StartsWith("异常") ? "err" : "ok"; resultDic.Add("result", result); resultDic.Add("status", status); return(resultDic); }
private void Html格式化toolStripMenuItem_Click(object sender, EventArgs e) { try { TxtHTML.Text = HtmlFormater.FormatHtml(TxtHTML.Text, true); } catch (Exception ex) { WriteErrMsg(ex.Message); } }