File tree Expand file tree Collapse file tree
templates/repo/issue/view_content Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ func (c *Comment) EventTag() string {
544544 return fmt .Sprintf ("event-%d" , c .ID )
545545}
546546
547- func (c * Comment ) GetSanitizeContentHTML () template.HTML {
547+ func (c * Comment ) GetSanitizedContentHTML () template.HTML {
548548 // mainly for type=4 CommentTypeCommitRef
549549 // the content is a link like <a href="{RepoLink}/commit/{CommitID}">message title</a> (from CreateRefComment)
550550 return markup .Sanitize (c .Content )
Original file line number Diff line number Diff line change 44package utils
55
66import (
7+ "html/template"
78 "testing"
89
910 "github.com/stretchr/testify/assert"
@@ -13,7 +14,7 @@ func TestSanitizeFlashErrorString(t *testing.T) {
1314 tests := []struct {
1415 name string
1516 arg string
16- want string
17+ want template. HTML
1718 }{
1819 {
1920 name : "no error" ,
@@ -28,7 +29,7 @@ func TestSanitizeFlashErrorString(t *testing.T) {
2829 {
2930 name : "line break error" ,
3031 arg : "some error:\n \n awesome!" ,
31- want : "some error:<br><br>awesome !" ,
32+ want : "some error:\n \n awesome !" ,
3233 },
3334 }
3435
Original file line number Diff line number Diff line change 164164 <div class= " detail flex-text-block" >
165165 {{svg " octicon-git-commit" }}
166166 {{/* the content is a link like <a href="{RepoLink}/commit/{CommitID}">message title</a> (from CreateRefComment) */ }}
167- <span class= " comment-text-line" >{{.GetSanitizeContentHTML }}</span>
167+ <span class= " comment-text-line" >{{.GetSanitizedContentHTML }}</span>
168168 </div>
169169 </div>
170170 {{else if eq .Type 7}}
You can’t perform that action at this time.
0 commit comments