dashboard does not display correctly badge links #14554

Open
opened 2025-11-02 11:16:03 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @mbarinc on GitHub (Jun 6, 2025).

Description

I use img.shields.io badges for decorating the PR. Badge links external tool that have the details.
In the PR the badges are correctly displayed, but in dashboard is only displayed the first badge.

Below the message on demo istance:
https://demo.gitea.com/barinz/test/pulls/1#issuecomment-7245

Screenshots

PR

Image

dashboard

Image

Gitea Version

1.25.0+dev-101-ge5781cec75

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

No response

Browser Version

Chrome latest version

Originally created by @mbarinc on GitHub (Jun 6, 2025). ### Description I use img.shields.io badges for decorating the PR. Badge links external tool that have the details. In the PR the badges are correctly displayed, but in dashboard is only displayed the first badge. Below the message on demo istance: https://demo.gitea.com/barinz/test/pulls/1#issuecomment-7245 ### Screenshots PR ![Image](https://github.com/user-attachments/assets/21da550d-608a-4048-ac83-259bc5e2eff3) dashboard ![Image](https://github.com/user-attachments/assets/1c57a999-2f92-49ae-bab4-0eb7fab96924) ### Gitea Version 1.25.0+dev-101-ge5781cec75 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System _No response_ ### Browser Version Chrome latest version
GiteaMirror added the topic/uiissue/not-a-bug labels 2025-11-02 11:16:03 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jun 6, 2025):

It's not really a bug, but the real problem is that the content is too long and it gets truncated.

Take HTML as an example, if the full content is:

<img1 very long .....><img2 very long .....><img3 very long .....>

But it gets truncated at "img2", then the output will be <img1 very long .....><img2 very, then you can see the correct "img1" but the remaining part won't be rendered.

The same to the markdown you shown.


I think there is no perfect fix for it when the truncation is still needed (to avoid overflowing user's dashboard)

@wxiaoguang commented on GitHub (Jun 6, 2025): It's not really a bug, but the real problem is that the content is too long and it gets truncated. Take HTML as an example, if the full content is: ``` <img1 very long .....><img2 very long .....><img3 very long .....> ``` But it gets truncated at "img2", then the output will be `<img1 very long .....><img2 very`, then you can see the correct "img1" but the remaining part won't be rendered. The same to the markdown you shown. ---- I think there is no perfect fix for it when the truncation is still needed (to avoid overflowing user's dashboard)
Author
Owner

@silverwind commented on GitHub (Jun 7, 2025):

The truncation could be made smarter. It should never truncate in the middle of a markdown link or HTML element, for example.

@silverwind commented on GitHub (Jun 7, 2025): The truncation could be made smarter. It should never truncate in the middle of a markdown link or HTML element, for example.
Author
Owner

@wxiaoguang commented on GitHub (Jun 7, 2025):

The truncation could be made smarter. It should never truncate in the middle of a markdown link or HTML element, for example.

Theoretically yes, while IMO it's not easy to have a perfect fix. For example: if we'd like to correctly "truncate" something like <a>a very looo.....ong sentence</a>, it needs a very flexible parser to handle every element. Considering that there are still many high priority problems to be solved in Gitea, this issue seems not that serious.

@wxiaoguang commented on GitHub (Jun 7, 2025): > The truncation could be made smarter. It should never truncate in the middle of a markdown link or HTML element, for example. Theoretically yes, while IMO it's not easy to have a perfect fix. For example: if we'd like to correctly "truncate" something like `<a>a very looo.....ong sentence</a>`, it needs a very flexible parser to handle every element. Considering that there are still many high priority problems to be solved in Gitea, this issue seems not that serious.
Author
Owner

@mbarinc commented on GitHub (Jun 9, 2025):

I understand that it's not a big problem, but I agree with Silverwind's post.
From the tests I've done the cut is about 200 characters, I think it's inside the code (it's only supposition). One option would be to have a system value that can be overridden by a parameter (for example in the app.ini file), so that anyone can choose whether or not to extend the length. It doesn't solve entirely the problem but it makes the dashboard more flexible.

@mbarinc commented on GitHub (Jun 9, 2025): I understand that it's not a big problem, but I agree with Silverwind's post. From the tests I've done the cut is about 200 characters, I think it's inside the code (it's only supposition). One option would be to have a system value that can be overridden by a parameter (for example in the app.ini file), so that anyone can choose whether or not to extend the length. It doesn't solve entirely the problem but it makes the dashboard more flexible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14554