How to auto close DD tags

Topics: Developer Forum, User Forum
Oct 26, 2012 at 2:40 AM

I'm currently working on a project where the HTML is not well formed, the developer has forgot to close one of their DD tags before opening the next dd tag.

In browser or for other tags this results in an auto close, where as with HtmlAgility this is current causing it to catch all of the subsequent dd tags.

Here is the HTML

 

"<dd>36 - SHORT <div class=\"invMsg0\"> In Stock. </div> <dt>Price:</dt> <dd style=\"margin-bottom: 15px;\"><span class=\"strike intlPrice\" usprice='$350.00'> $350.00 </span>&nbsp;&nbsp; <span class=\"sale intlPrice\" usprice='$122.50'> $122.50 </span> \r\

n <span class=\"price intlPrice\" usprice='$122.50'>$122.50</span> </dd> <dt><label for=\"qty2\">Qty:</label></dt> <dd> <select id=\"qty2\" name=\"quantity_1\" onchange=\"javascript:updateSCupdate(this.value, '315201_3539253');\"> <option selected=\"\" value=\"1\">1 <option value=\"2\">2

<option value=\"3\">3 <option value=\"4\">4 <option value=\"5\">5 <option value=\"6\">6 <option value=\"7\">7 <option value=\"8\">8 <option value=\"9\">9 <option value=\"10\">10 </select> </dd> </dd>"

 

Is there any way to get HTMLAgility to auto close the DD tag when it sees the first DT ?