-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Light cleanup on html_render_diff.py #145
Draft
Mr0grog
wants to merge
7
commits into
main
Choose a base branch
from
a-wee-bit-of-html-render-diff-cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on May 2, 2023
-
Trim spaces around docstring text, use consistent style for multiline docstrings.
Configuration menu - View commit details
-
Copy full SHA for 4d7082c - Browse repository at this point
Copy the full SHA 4d7082cView commit details -
In diffs that went over the maximum number of spacers, it turns out that the `_limit_spacers()` function stripped out important tag information! This fixes the issue, but introduces some performance overhead. To handle that, a follow-on change should consider: 1. Moving the spacer-limiting logic into `customize_tokens()` so we don't even create too many spacers in the first place. 2. Revisit the whole spacer approach in the first place. There may be better approaches now.
Configuration menu - View commit details
-
Copy full SHA for 5b2db97 - Browse repository at this point
Copy the full SHA 5b2db97View commit details -
Make contrast script a raw string
This resolves some not-useful warnings about invalid escapes that we were getting. Nothing should be escaped in here in the first place; it's a pure JavaScript string with no substitutions or dynamic values.
Configuration menu - View commit details
-
Copy full SHA for 38245ef - Browse repository at this point
Copy the full SHA 38245efView commit details -
Remove vestigial token balancing code
There's a big TODO about removing this when we finally fully forked lxhtml's differ. That happened a long time ago, and we did in fact make the changes that turned this into effectively wasted iteration/dead code. I ran a few tests over a variety of big and small diffs to make sure the code being removed here really doesn't do anything anymore, and that seems to be the case. Reading the logic, it also seems like this should be entirely vestigial, and never wind up actually changing the tokens.
Configuration menu - View commit details
-
Copy full SHA for 2e4483d - Browse repository at this point
Copy the full SHA 2e4483dView commit details -
The only thing this function was doing was replacing `href_token` instances with `MinimalHrefToken`. We did this at a time when we were using parts of the tokenization internals from lxml instead of fully forking it. We have long since fully forked it, however, and we should just be creating `MinimalHrefToken` where we want them in the first place instead of looping through and replacing other tokens with them.
Configuration menu - View commit details
-
Copy full SHA for cb540b6 - Browse repository at this point
Copy the full SHA cb540b6View commit details -
Rename
_customize_tokens
to_insert_spacers
This is now more accurate to what the function does.
Configuration menu - View commit details
-
Copy full SHA for 6b425b6 - Browse repository at this point
Copy the full SHA 6b425b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b020d0c - Browse repository at this point
Copy the full SHA b020d0cView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.