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

The html rendering result is different from the html output result when tbody is added inside unclosed th #530

Closed
pauloortins opened this issue Jan 5, 2024 · 3 comments
Assignees

Comments

@pauloortins
Copy link

When we have a tbody tag inside a unclosed th then the output is different from the way chrome renders it.
While closes the entire thead, HAP adds the tbody tag inside the th.

HTML: <table><thead><tr><th></th><th></th><th><tbody></table>
HAP Result: <table><thead><tr><th></th><th></th><th><tbody></tbody></th></tr></thead></table>
Chrome Result: <table><thead><tr><th></th><th></th><th></th></tr></thead><tbody></tbody></table>

This is the test I used:

var html = @"<table><thead><tr><th></th><th></th><th><tbody></table>";
var doc = new HtmlDocument();
doc.LoadHtml(html);
var newHtml = doc.DocumentNode.OuterHtml;  //<table><thead><tr><th></th><th></th><th><tbody></tbody></th></tr></thead></table>
var res = @"<table><thead><tr><th></th><th></th><th></th></tr></thead><tbody></tbody></table>"; //chrome or edge rendering results
var b = newHtml == res; //false
@JonathanMagnan JonathanMagnan self-assigned this Jan 6, 2024
JonathanMagnan added a commit that referenced this issue Jan 6, 2024
@JonathanMagnan
Copy link
Member

Thank you for reporting.

The fix has been done and will be available the next time we deploy Html Agility Pack

Best Regards,

Jon

@JonathanMagnan
Copy link
Member

Hello @pauloortins ,

The v1.11.58 has been released.

The issue you reported should now be fixed.

Best Regards,

Jon

@pauloortins
Copy link
Author

pauloortins commented Jan 29, 2024 via email

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