mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-25 14:12:00 +00:00
Backport #39076 by @4RH1T3CT0R7 Bot co-authors like `dependabot[bot]` render as one long string with the email inside the name, and never get truncated, so they overflow the column. Co-author idents are parsed with `net/mail`, but a git ident isn't an email address. `mail.ParseAddress` rejects the whole value when the name holds characters RFC 5322 reserves, like a `[bot]` suffix or a comma, so the error branch keeps the raw trailer as the display name and throws the address away. No address means no `mailto:` link, and the anchor is what `.avatar-stack-names` truncates. So parse the angle-addr ourselves when `net/mail` won't take it. Splitting on the last `<` is safe because git strips angle brackets from idents. The bare-name branch gets the class too. Fixes https://github.com/go-gitea/gitea/issues/38949 Co-authored-by: Artem Lytkin <146867384+4RH1T3CT0R7@users.noreply.github.com>
This commit is contained in:
@@ -415,7 +415,7 @@ func (ut *RenderUtils) participantNameLink(data *user_model.AvatarStackData, par
|
||||
if participant.GitIdentity.Email != "" {
|
||||
return htmlutil.HTMLFormat(`<a class="muted" href="mailto:%s">%s</a>`, participant.GitIdentity.Email, participant.GitIdentity.Name)
|
||||
}
|
||||
return template.HTML(template.HTMLEscapeString(participant.GitIdentity.Name))
|
||||
return htmlutil.HTMLFormat(`<span class="avatar-stack-name">%s</span>`, participant.GitIdentity.Name)
|
||||
}
|
||||
|
||||
func (ut *RenderUtils) participantPopupRow(data *user_model.AvatarStackData, participant *user_model.CommitParticipant) template.HTML {
|
||||
|
||||
Reference in New Issue
Block a user