Skip to content

Commit

Permalink
Fix template bugs in recently_pushed_new_branches.tmpl (#26744)
Browse files Browse the repository at this point in the history
Fix some bugs from #25715, fix #25830

1. `$.locale.Tr ... Safe` needs `Escape`, but not `PathEscapeSegments`
2. The attribute should be `role`
3. The `ComposeBranchCompareURL` already does escaping correctly
  • Loading branch information
wxiaoguang authored Aug 27, 2023
1 parent 4fdb09d commit 5914a2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/repo/code/recently_pushed_new_branches.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div class="ui positive message gt-df gt-ac">
<div class="gt-f1">
{{$timeSince := TimeSince .CommitTime.AsTime $.locale}}
{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (PathEscapeSegments .Name) $timeSince | Safe}}
{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}}
</div>
<a aria-role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo (PathEscapeSegments .Name)}}">
<a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}">
{{$.locale.Tr "repo.pulls.compare_changes"}}
</a>
</div>
Expand Down

0 comments on commit 5914a2f

Please sign in to comment.