-
-
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 in the web interface #13342
Comments
HTML source looks rather broken too with a 0x03 character in there:
|
The issue is that the diff library appears to be diffing the html entities at the subentity level. so |
I think we should just be letting chroma do the highlighting by passing in a HighlightRanges() and adjusting the format that chroma.LineHighlight sets. |
I'm too tired to do this right now but the idea would be rewrite gitdiff.go GetComputedInlineDiffFor to generate the line patches first and then pass to another highlight.Code - which would do the addition and deletion bits with the appropriate bits highlighted by calling the HighlightRanges and adjust LineHighlight options as appropriate. |
(@mrsdizzie you don't have to fix - but if you understand what I'm getting at feel free to have a go.) |
Grr yea : ( I'm away for a few days but could take a look after |
ugh the highlight trick suggested above doesn't work. |
Fix go-gitea#13342 Signed-off-by: Andrew Thornton <[email protected]>
OK I worked it - we just have to iterate through the diffs and run a fix up for the broken entities. Now doing this I note that we end up creating these line diffs twice - which seems excessive to me - so clearly there are improvements to be made here. |
* When creating line diffs do not split within an html entity Fix #13342 Signed-off-by: Andrew Thornton <[email protected]> * Add test case Signed-off-by: Andrew Thornton <[email protected]> * improve test Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
…#13357) Backport go-gitea#13357 * When creating line diffs do not split within an html entity Fix go-gitea#13342 Signed-off-by: Andrew Thornton <[email protected]> * Add test case Signed-off-by: Andrew Thornton <[email protected]> * improve test Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
…13375) Backport #13357 * When creating line diffs do not split within an html entity Fix #13342 Signed-off-by: Andrew Thornton <[email protected]> * Add test case Signed-off-by: Andrew Thornton <[email protected]> * improve test Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1.14.0+dev-18-gd453533be
2.26.2
Ubuntu 18.04.3 LTS
[x]
):Description
The ' and " characters are displayed incorrectly when diff files are displayed in the web interface:
https://try.gitea.io/sergey.savatin/test_diff/commit/62d96b3486efecfce9736c7c3382077c10bfa6c4
Screenshots
The text was updated successfully, but these errors were encountered: