Symbol '<' in script cause xml output error

Topics: User Forum
Jan 19, 2007 at 1:07 AM
Hi Simonm, Thank you for your effort on HtmlAgilityPack. I found a small bug today.
For HtmlDocument, if you use OptionOutputAsXml to convert html into xml, following html generate error.

html:
<script>if(0<1){document.write(1);}</script>

HtmlAgilityPack Xml Output (Not Right):
<script>
//<![CDATA[
if(0<1){document.write(1);}
//]]>//
</script>

Right Output:
<script>
//<![CDATA[
if(0<1){document.write(1);}
//]]>//
</script>

Regards.