-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix error in diff html rendering #13191
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Was missing an optional whitespace check in regex. Also noticed a rare case where diff.Type == Equal would be empty and thus get a newline attached. Fixed that too. Fixes go-gitea#13177
zeripath
reviewed
Oct 17, 2020
Co-authored-by: zeripath <[email protected]>
zeripath
approved these changes
Oct 18, 2020
Maybe worth adding a test for? |
Codecov Report
@@ Coverage Diff @@
## master #13191 +/- ##
==========================================
- Coverage 42.01% 42.01% -0.01%
==========================================
Files 683 683
Lines 75215 75215
==========================================
- Hits 31605 31601 -4
- Misses 38443 38450 +7
+ Partials 5167 5164 -3
Continue to review full report at Codecov.
|
techknowlogick
approved these changes
Oct 18, 2020
mrsdizzie
added a commit
to mrsdizzie/gitea
that referenced
this pull request
Oct 21, 2020
A better fix for go-gitea#13191 which cleans up this code a bit and adds basic checking which should avoid writing broken HTML in future situations.
ivanvc
added a commit
to ivanvc/gitea
that referenced
this pull request
Oct 21, 2020
…ments-in-pull-request-label-style * origin/master: (27 commits) [skip ci] Updated translations via Crowdin add more clarification to the issue-template.md (go-gitea#13235) go-version constraints ignore pre-releases (go-gitea#13234) [skip ci] Updated translations via Crowdin Update some JS dependencies (go-gitea#13222) Return the full rejection message and errors in flash errors (go-gitea#13221) Update heatmap fixtures to restore tests (go-gitea#13224) [skip ci] Updated translations via Crowdin Add review request api (go-gitea#11355) [skip ci] Updated translations via Crowdin When the git ref is unable to be found return broken pr (go-gitea#13218) Various arc-green fixes (go-gitea#13214) Show stale label for stale code comment which is marked as resolved (go-gitea#13213) Move install pages out of main macaron routes (go-gitea#13195) Use CSS Variables for fonts, remove postcss-loader (go-gitea#13204) [skip ci] Updated translations via Crowdin Align `SSH_AUTHORIZED_KEYS_BACKUP` var with the value in `app.ini` (go-gitea#13212) Fix size and clickable area on file table back link (go-gitea#13205) [skip ci] Updated translations via Crowdin Fix error in diff html rendering (go-gitea#13191) ...
techknowlogick
added a commit
that referenced
this pull request
Oct 21, 2020
* Add better error checking for inline html diff code A better fix for #13191 which cleans up this code a bit and adds basic checking which should avoid writing broken HTML in future situations. * Update gitdiff_test.go * better regex Co-authored-by: techknowlogick <[email protected]>
mrsdizzie
added a commit
to mrsdizzie/gitea
that referenced
this pull request
Oct 21, 2020
* Fix error in diff html rendering Was missing an optional whitespace check in regex. Also noticed a rare case where diff.Type == Equal would be empty and thus get a newline attached. Fixed that too. Fixes go-gitea#13177 * Update services/gitdiff/gitdiff.go Co-authored-by: zeripath <[email protected]> * Update gitdiff_test.go * fmt Co-authored-by: zeripath <[email protected]>
mrsdizzie
added a commit
to mrsdizzie/gitea
that referenced
this pull request
Oct 21, 2020
* Add better error checking for inline html diff code A better fix for go-gitea#13191 which cleans up this code a bit and adds basic checking which should avoid writing broken HTML in future situations. * Update gitdiff_test.go * better regex Co-authored-by: techknowlogick <[email protected]>
techknowlogick
pushed a commit
that referenced
this pull request
Oct 22, 2020
* Fix error in diff html rendering (#13191) * Fix error in diff html rendering Was missing an optional whitespace check in regex. Also noticed a rare case where diff.Type == Equal would be empty and thus get a newline attached. Fixed that too. Fixes #13177 * Update services/gitdiff/gitdiff.go Co-authored-by: zeripath <[email protected]> * Update gitdiff_test.go * fmt Co-authored-by: zeripath <[email protected]> * Add better error checking for inline html diff code (#13239) * Add better error checking for inline html diff code A better fix for #13191 which cleans up this code a bit and adds basic checking which should avoid writing broken HTML in future situations. * Update gitdiff_test.go * better regex Co-authored-by: zeripath <[email protected]>
I guess the backport for this was included in #13239 |
@zeripath indeed it was |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
skip-changelog
This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
type/bug
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.
Was missing an optional whitespace check in regex. Also noticed a rare case where diff.Type == Equal text would be empty and thus get a newline attached. Fixed that too.
Fixes #13177