jamietre / CsQuery

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

Prevent breaking leading xml tag #142

Open ArtyomBaranovskiy opened 10 years ago

ArtyomBaranovskiy commented 10 years ago

Hello,

I'm using your tool to build a kind of WebGrabber so I have to handle really many cases. One of them is the html document with "<?xml ... ?> tag instead of DocType. It's rendered by any modern browser without errors so I expect the same functionality from CSQuery. However, default output formatter transorms the tag into " which is handled in incorrect way by browsers.

I suggest the following pull request to fix the issue. I'm sorry for having no time to dig deeper to the root cause why described tag is parsed as html comment.

Short commit description:

1)Prevent Default OutputFormatter from breaking leading xml comment