Esempio n. 1
0
        public void TestWriting()
        {
            var writer = new HtmlWriter();
            TagParser.Parse(html, writer);

            Assert.AreEqual(htmlWritten, writer.ToString());
        }
Esempio n. 2
0
        public void TestCleaning()
        {
            var writer = new HtmlWriter();
            var clean = new HtmlCleaner(writer);
            TagParser.Parse(html, clean);

            Assert.AreEqual(htmlCleaned, writer.ToString());
        }
Esempio n. 3
0
 public static string Clean(string raw)
 {
     var w = new StringWriter();
     var writer = new HtmlWriter(w);
     var cleaner = new HtmlCleaner(writer);
     TagParser.Parse(raw, cleaner);
     return w.GetStringBuilder().ToString();
 }