Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Table TD cells are mis-nested during comparison #5
I have made a diff for 2 HTML files that have a tables inside. Table cells are colspan-ed and rowspan-ed. As the result I see that TD cells are mis-nested (it seems - due to different styles - not sure).
The test files for the issue I am describing are available here: http://dimaka.com/download/Issue_html_diff_tables.zip
You could see below - that difference is the only styles - not the text content. In short, the problem looks like this one:
In SOURCE html file it was:
In TARGET html file it was:
In DIFF_RESULTS html file it becomes wrong (opening TD tag):
Please let me know how to fix it? And if you are going to update the sources - when it could happen?
You've spotted a bug. The issue is that the attribute for the td differs. The culprit is the width. In the source it's 198.45, in the target it is 191.35.
Attribute changes aren't really supported. In general, I think we should actually ignore them as it's difficult to assess whether to highlight changes to attributes or not. I've updated the code to ignore attributes, but this could cause some unexpected issues. I've added a new test case and all existing tests are passing so I would be keen to get your feedback.
I've pushed the change.