-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
diff view leaks some html code #13177
Comments
Heya @mrsdizzie are you able to take a look? |
@zig as you are running a development version, could you upgrade to the latest commit? There have been some changes to the above (specifically diff handling & chroma) |
This was a bug that was fixed a few months ago during syntax highlighting transition and shouldn't be present anymore. Can you link to a current example of this? Or put up an example on try.gitea.io. If it isn't private you could just push the repo and it would retain the commit history that should produce the diff. I tried to reproduce with the small example given but it looks ok to me: https://try.gitea.io/mrsdizzie/testme/commit/3d06f1f836fc248bbba9be7a8c18d019559e7ccb But it might depend on other information so an example to see would be best. Thanks! |
@mrsdizzie thanks for looking into this, in your test you added a space between https://try.gitea.io/zigg/testme/commit/9bd6915f409b3ae13dd284a716212059129c8dfe |
@zig thanks, will look into |
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
* 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]>
* 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]>
* 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]>
[x]
):Description
Diff view sometimes show additional html tag that should not be visible
Screenshots
But it should be :
Note however that the extra tag is not visible in the file view :
The text was updated successfully, but these errors were encountered: