mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor locale&string&template related code (#29165)
Clarify when "string" should be used (and be escaped), and when "template.HTML" should be used (no need to escape) And help PRs like #29059 , to render the error messages correctly.
This commit is contained in:
@@ -56,12 +56,12 @@ func GetContentHistoryList(ctx *context.Context) {
|
||||
for _, item := range items {
|
||||
var actionText string
|
||||
if item.IsDeleted {
|
||||
actionTextDeleted := ctx.Locale.Tr("repo.issues.content_history.deleted")
|
||||
actionTextDeleted := ctx.Locale.TrString("repo.issues.content_history.deleted")
|
||||
actionText = "<i data-history-is-deleted='1'>" + actionTextDeleted + "</i>"
|
||||
} else if item.IsFirstCreated {
|
||||
actionText = ctx.Locale.Tr("repo.issues.content_history.created")
|
||||
actionText = ctx.Locale.TrString("repo.issues.content_history.created")
|
||||
} else {
|
||||
actionText = ctx.Locale.Tr("repo.issues.content_history.edited")
|
||||
actionText = ctx.Locale.TrString("repo.issues.content_history.edited")
|
||||
}
|
||||
|
||||
username := item.UserName
|
||||
|
Reference in New Issue
Block a user