-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
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
Co-authored-by: zeripath <[email protected]>
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.
|
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.
…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) ...
* 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]>
* 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]>
* 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]>
* 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 |
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