Expanding diff view broken #8358

Closed
opened 2025-11-02 08:03:33 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @noerw on GitHub (Jan 15, 2022).

Gitea Version

1.16.0+dev-841-gd413a1f8a d413a1f8a

Git Version

Operating System

latest firefox

How are you running Gitea?

irrelevant

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

Expanding a diff results in broken rendering of the diff, see also attached video.

afaik this happens on PR diff page, as well as commit diff page.

Screenshots

https://user-images.githubusercontent.com/7880552/149620722-e04edca2-fa83-4a52-8474-414dd610cd72.mp4

Originally created by @noerw on GitHub (Jan 15, 2022). ### Gitea Version 1.16.0+dev-841-gd413a1f8a d413a1f8a ### Git Version - ### Operating System latest firefox ### How are you running Gitea? irrelevant ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description Expanding a diff results in broken rendering of the diff, see also attached video. afaik this happens on PR diff page, as well as commit diff page. ### Screenshots https://user-images.githubusercontent.com/7880552/149620722-e04edca2-fa83-4a52-8474-414dd610cd72.mp4
GiteaMirror added the topic/uitype/bug labels 2025-11-02 08:03:33 -06:00
Author
Owner

@silverwind commented on GitHub (Jan 15, 2022):

Weird one, the JS spews some apparently escaped HTML into the DOM.

image

I think it must be a recent regression. Maybe worth a bisect.

@silverwind commented on GitHub (Jan 15, 2022): Weird one, the JS spews some apparently escaped HTML into the DOM. <img width="707" alt="image" src="https://user-images.githubusercontent.com/115237/149629495-18361cc0-648e-49ec-a48a-3e144af9edc8.png"> I think it must be a recent regression. Maybe worth a bisect.
Author
Owner

@wxiaoguang commented on GitHub (Jan 15, 2022):

The bug is caused by we wrote <code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code> ( Add warning for BIDI characters in page renders and in diffs (#17562) )

Before, GetComputedInlineDiffFor returns HTML text.

Now, GetComputedInlineDiffFor returns DiffInline struct, so we should change the forgotten {{$.section.GetComputedInlineDiffFor $line}} call to output the DiffInline.Content.

Possible code:

d7c2a2951c/templates/repo/diff/blob_excerpt.tmpl (L71)

@wxiaoguang commented on GitHub (Jan 15, 2022): The bug is caused by we wrote `<code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code>` ( Add warning for BIDI characters in page renders and in diffs (#17562) ) Before, `GetComputedInlineDiffFor` returns HTML text. Now, `GetComputedInlineDiffFor` returns `DiffInline` struct, so we should change the forgotten `{{$.section.GetComputedInlineDiffFor $line}}` call to output the `DiffInline.Content`. Possible code: https://github.com/go-gitea/gitea/blob/d7c2a2951c6a0a85f43675c83d3d639cd50eccb4/templates/repo/diff/blob_excerpt.tmpl#L71
Author
Owner

@zeripath commented on GitHub (Jan 15, 2022):

agh this is due to an interaction between the BIDI pr and the diff PR.

When the diff PR was created the BIDI PR wasn't merged and when the BIDI PR was created the diff PR wasn't merged.

@zeripath commented on GitHub (Jan 15, 2022): agh this is due to an interaction between the BIDI pr and the diff PR. When the diff PR was created the BIDI PR wasn't merged and when the BIDI PR was created the diff PR wasn't merged.
Author
Owner

@zeripath commented on GitHub (Jan 15, 2022):

Actually no it's a bit of debugging code that got left in.

@zeripath commented on GitHub (Jan 15, 2022): Actually no it's a bit of debugging code that got left in.
Author
Owner

@andre161292 commented on GitHub (Feb 1, 2022):

This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io).

I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image.

@andre161292 commented on GitHub (Feb 1, 2022): This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io). I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image.
Author
Owner

@wxiaoguang commented on GitHub (Feb 1, 2022):

I managed to reproduce the bug:

image
@wxiaoguang commented on GitHub (Feb 1, 2022): I managed to reproduce the bug: <img width="1353" alt="image" src="https://user-images.githubusercontent.com/2114189/151939957-d32d55e6-db08-43a0-97a9-06fd199e969f.png">
Author
Owner

@wxiaoguang commented on GitHub (Feb 1, 2022):

This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io).

I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image.

@andre161292 if you meet other bugs, please help to tell the Gitea team how to reproduce it and get a screenshot. Thank you very much ~~

@wxiaoguang commented on GitHub (Feb 1, 2022): > This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io). > > I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image. @andre161292 if you meet other bugs, please help to tell the Gitea team how to reproduce it and get a screenshot. Thank you very much ~~
Author
Owner

@lunny commented on GitHub (Feb 1, 2022):

#18516 and #18517 have reported the problem.

@lunny commented on GitHub (Feb 1, 2022): #18516 and #18517 have reported the problem.
Author
Owner

@zeripath commented on GitHub (Feb 1, 2022):

Fixed by #18502

@zeripath commented on GitHub (Feb 1, 2022): Fixed by #18502
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8358