diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-02-25 22:02:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 14:02:20 +0000 |
commit | d2f6588b66549b33adf8bac7044d03c89d668470 (patch) | |
tree | 7cc1109b7bd757ffd9e9e9cc2eb038b024290f3f /templates/package | |
parent | ea164aba4b697aa08e4d20d896a8f318c09a6523 (diff) | |
download | gitea-d2f6588b66549b33adf8bac7044d03c89d668470.tar.gz gitea-d2f6588b66549b33adf8bac7044d03c89d668470.zip |
Remove incorrect and unnecessary Escape from templates (#29394)
Follow #29165
* some of them are incorrect, which would lead to double escaping (eg:
`(print (Escape $.RepoLink)`)
* other of them are not necessary, because `Tr` handles strings&HTML
automatically
Suggest to review by "unified view":
https://github.com/go-gitea/gitea/pull/29394/files?diff=unified&w=0
Diffstat (limited to 'templates/package')
-rw-r--r-- | templates/package/shared/list.tmpl | 4 | ||||
-rw-r--r-- | templates/package/shared/versionlist.tmpl | 2 | ||||
-rw-r--r-- | templates/package/view.tmpl | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index 8c8b113c97..51e080f495 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -30,9 +30,9 @@ {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} {{end}} {{if $hasRepositoryAccess}} - {{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape)}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink .Creator.GetDisplayName .Repository.Link .Repository.FullName}} {{else}} - {{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape)}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink .Creator.GetDisplayName}} {{end}} </div> </div> diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl index 4b22dc22b2..eee952c096 100644 --- a/templates/package/shared/versionlist.tmpl +++ b/templates/package/shared/versionlist.tmpl @@ -25,7 +25,7 @@ <div class="flex-item-main"> <a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a> <div class="flex-item-body"> - {{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape)}} + {{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink .Creator.GetDisplayName}} </div> </div> </div> diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index 65502a6e4d..0fa23d67fd 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -10,9 +10,9 @@ <div> {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}} {{if .HasRepositoryAccess}} - {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape)}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}} {{else}} - {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape)}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}} {{end}} </div> </div> |