File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "code.gitea.io/gitea/modules/setting"
2828 "code.gitea.io/gitea/modules/timeutil"
2929 "code.gitea.io/gitea/modules/util"
30+ "code.gitea.io/gitea/services/gitdiff"
3031
3132 "gopkg.in/editorconfig/editorconfig-core-go.v1"
3233)
@@ -230,6 +231,7 @@ func NewFuncMap() []template.FuncMap {
230231 }
231232 return float32 (n ) * 100 / float32 (sum )
232233 },
234+ "MustAsDiff" : gitdiff .CommentMustAsDiff ,
233235 }}
234236}
235237
Original file line number Diff line number Diff line change @@ -822,7 +822,7 @@ func CommentAsDiff(c *models.Comment) (*Diff, error) {
822822func CommentMustAsDiff (c * models.Comment ) * Diff {
823823 diff , err := CommentAsDiff (c )
824824 if err != nil {
825- log .Warn ("MustAsDiff : %v" , err )
825+ log .Warn ("CommentMustAsDiff : %v" , err )
826826 }
827827 return diff
828828}
Original file line number Diff line number Diff line change 319319 {{end}}
320320 <a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment">{{$filename}}</a>
321321 </div>
322- {{$diff := ((index $comms 0).MustAsDiff )}}
322+ {{$diff := (CommentMustAsDiff (index $comms 0))}}
323323 {{if $diff}}
324324 {{$file := (index $diff.Files 0)}}
325325 <div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $invalid}} hide{{end}}">
You can’t perform that action at this time.
0 commit comments