Exemple #1
0
        public void TestFilter()
        {
            var input    = "<div>dd</div><a id=\"testId\" href=\"http://code.google.com/p/nhtmlfilter\" onclick=\"return 123;\">nhtmlfilter</a>";
            var expected = "dd<a href=\"http://code.google.com/p/nhtmlfilter\">nhtmlfilter</a>";

            Assert.AreEqual(expected, _target.filter(input));
        }
Exemple #2
0
 /// <summary>
 /// 过滤字符串
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 protected string FilterParamters(string value)
 {
     value = value ?? string.Empty;
     GetNHtmlFilterInstance();
     return(_nHtmlFilter.filter(value.Trim()));
 }