Skip to content
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

Colons In Attribute Names Mangled With OptionOutputAsXml and LoadHtml #95

Closed
mbrierst opened this issue Oct 30, 2017 · 3 comments
Closed
Assignees

Comments

@mbrierst
Copy link

When using LoadHtml to import html containing attribute names containing colons (for example when using namespaces) and using OptionOutputAsXml = true, the attribute names become horribly mangled. See this example which works fine:

var d = new HtmlDocument { OptionOutputAsXml = false };
d.LoadHtml("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><script xlink:href=\"cool-script.js\" type=\"text/ecmascript\"/></svg>");
MessageBox.Show(d.DocumentNode.InnerHtml);

And this example where the attribute names are badly mangled:

var d = new HtmlDocument { OptionOutputAsXml = true };
d.LoadHtml("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><script xlink:href=\"cool-script.js\" type=\"text/ecmascript\"/></svg>");
MessageBox.Show(d.DocumentNode.InnerHtml);
@JonathanMagnan JonathanMagnan self-assigned this Oct 31, 2017
@JonathanMagnan
Copy link
Member

Hello @mbrierst ,

Thank you for letting me know, I will check how attribute is managed in this library later today probably.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @mbrierst ,

The v1.6.3 has been released,

attribute name should now be parsed correctly

Let me know if that's fixed.

Best Regards,

Jonathan

@mbrierst
Copy link
Author

mbrierst commented Nov 1, 2017

Looks like this fixed it for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants