Skip to content

Commit 0e214c7

Browse files
committed
Stop double encoding blame commit messages (go-gitea#17498)
Backport go-gitea#17498 The call to html.EscapeString in routers/web/repo/blame.go:renderBlame is extraneous as the commit message is now rendered by the template. The template will correctly escape strings - therefore we are currently double escaping. This PR fixes this. Fix go-gitea#17492 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 34650b9 commit 0e214c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routers/web/repo/blame.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package repo
77
import (
88
"container/list"
99
"fmt"
10-
"html"
1110
gotemplate "html/template"
1211
"net/http"
1312
"strings"
@@ -244,7 +243,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
244243
br.PreviousSha = previousSha
245244
br.PreviousShaURL = fmt.Sprintf("%s/blame/commit/%s/%s", repoLink, previousSha, ctx.Repo.TreePath)
246245
br.CommitURL = fmt.Sprintf("%s/commit/%s", repoLink, part.Sha)
247-
br.CommitMessage = html.EscapeString(commit.CommitMessage)
246+
br.CommitMessage = commit.CommitMessage
248247
br.CommitSince = commitSince
249248
}
250249

0 commit comments

Comments
 (0)