-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent comment rendering #525
Comments
Hello @mems , Thank you for reporting. Indeed something doesn't work in this logic. We will look at it. Best Regards, Jon |
Hello @mems , We have released today the v1.11.55: https://github.com/zzzprojects/html-agility-pack/releases/tag/v1.11.55 You can see this commit that will explain what we did: In this version:
You can see the following Fiddle with your case on this new version: https://dotnetfiddle.net/6LvV3S Which has the following output:
Let me know if we missing something. Best Regards, Jon |
please note that the code in HtmlDocument.cs adds surrounding spaces to the comment, something it should not do. Instead of EDIT: I made a pull request for this: #528 |
Since there is a release version that fix my issue, I close it now. Thank you @JonathanMagnan |
1. Description
It's not clear if
HtmlDocument.CreateComment()
need to include<!--
and-->
. If it's included,OuterHtml
include it twice.If it's not,
WriteTo()
withOptionOutputAsXml = true
could raise an exception.Note: the HTML Standard indicate HTML comments can't contains some sequences:
2. Exception
3. Fiddle or Project
A Fiddle that reproduce the issue: https://dotnetfiddle.net/vARPlD
Will outuput:
The text was updated successfully, but these errors were encountered: