Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134580: Modernizingdifflib.HtmlDiff for HTML Output#134581

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Wulian233 wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromWulian233:difflib-html

Conversation

Wulian233
Copy link
Contributor

@Wulian233Wulian233 commentedMay 23, 2025
edited
Loading

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:

Before:

屏幕截图 2025-05-22 204245

After:
屏幕截图 2025-05-22 204257

Before:
屏幕截图 2025-05-22 204628

After:
屏幕截图 2025-05-22 210619


📚 Documentation preview 📚:https://cpython-previews--134581.org.readthedocs.build/

@hugovk
Copy link
Member

Thanks, I think this is an improvement.

Before

image

After

image

And

Here's a GitHub diff:

image

Similarly, I think we should keep the lines a bit tighter together.

Here's the PR with the vertical padding removed:

image

Shall we remove that padding?

And shall we centre the table on the page?

@Wulian233
Copy link
ContributorAuthor

Wulian233 commentedMay 23, 2025
edited
Loading

Similarly, I think we should keep the lines a bit tighter together.
Here's the PR with the vertical padding removed:

It's a good improvement, and this is what it looks like now
屏幕截图 2025-05-23 211103

And shall we centre the table on the page?

I before thought about this, but the table width is determined based on the length of the content and the code specified, like

'<h2>tabsize=2</h2>',

             '<h2>tabsize=2</h2>',             j.make_table(f2,t2),             '<h2>tabsize=default</h2>',

屏幕截图 2025-05-23 211452

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 :)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Wulian233@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp