public void handles_unknown_inline_tags() { string h = "<p><cust>Test</cust></p><p><cust><cust>Test</cust></cust></p>"; HtmlDocument doc = HtmlParser.ParseBodyFragment(h, null); string output = doc.Body.InnerHtml; Assert.Equal(h, TextUtil.StripNewLines(output)); }
public void parses_body_fragment() { string h = "<!-- comment --><p><a href='foo'>One</a></p>"; HtmlDocument doc = HtmlParser.ParseBodyFragment(h, new Uri("http://example.com")); Assert.Equal("<body><!-- comment --><p><a href=\"foo\">One</a></p></body>", TextUtil.StripNewLines(doc.Body.OuterHtml)); var a = doc.QuerySelector("a"); Assert.Equal(new Uri("http://example.com/foo"), new Uri(a.BaseUri, a.Attribute("href"))); }