Uh oh!
There was an error while loading. Please reload this page.
gh-134580: Modernizing difflib.HtmlDiff for HTML Output - #134581
Conversation
hugovk
commented
May 23, 2025
It's a good improvement, and this is what it looks like now
I before thought about this, but the table width is determined based on the length of the content and the code specified, like cpython/Lib/test/test_difflib.py Line 227 in 1288aa1 If we center the table, there will be a lot of space on both sides of the screen, and it may not be as easy to distinguish as if the table is narrow. So I didn't do that, and my opinion is also to keep the left alignment the way :) |
Uh oh!
There was an error while loading. Please reload this page.
Head branch was pushed to by a user without write access
…on#134581) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…on#134581) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…on#134581) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>






Improved the styling of HTML diff pages generated by the difflib.HtmlDiff` class, and migrated the output to the HTML5 standard.
And all browser warnings have been eliminated.
details see: #134580
Request review @hugovk thanks!
Screenshot:
Details
Before:After:

Before:

After:

difflib.HtmlDifffor HTML Output #134580📚 Documentation preview 📚: https://cpython-previews--134581.org.readthedocs.build/