Merge pull request 'feat(ui): Add rel="nofollow" to in-list labels' (#5002) from xlii/forgejo:forgejo into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5002
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Gusted 2024-08-21 19:54:59 +00:00
commit e3243a9465
4 changed files with 29 additions and 12 deletions

View file

@ -245,7 +245,7 @@ func RenderLabels(ctx context.Context, locale translation.Locale, labels []*issu
if isPull {
issuesOrPull = "pulls"
}
htmlCode += fmt.Sprintf("<a href='%s/%s?labels=%d'>%s</a> ",
htmlCode += fmt.Sprintf("<a href='%s/%s?labels=%d' rel='nofollow'>%s</a> ",
repoLink, issuesOrPull, label.ID, RenderLabel(ctx, locale, label))
}
htmlCode += "</span>"