jamietre / CsQuery

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4.
Other
1.16k stars 249 forks source link

Parse problem: closed void tag with XHTML #202

Open Risord opened 8 years ago

Risord commented 8 years ago
var html = "<div><br></br></div>";
var cs = new CsQuery.CQ(html, CsQuery.HtmlParsingMode.Fragment, CsQuery.HtmlParsingOptions.AllowSelfClosingTags, CsQuery.DocType.XHTML);
cs.Render();

Expected result:

<div><br></div>

Result:

<div><br><br></div>

This should be valid representation of br tag in XHTML, source: https://validator.w3.org

<br></br>
Risord commented 8 years ago

Edit: Fixed markdown presentation