Skip to content

Commit 4e8a817

Browse files
authored
Stop double encoding blame commit messages (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 <art27@cantab.net>
1 parent 1ff944f commit 4e8a817

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routers/web/repo/blame.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package repo
66

77
import (
88
"fmt"
9-
"html"
109
gotemplate "html/template"
1110
"net/http"
1211
"strings"
@@ -239,7 +238,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
239238
br.PreviousSha = previousSha
240239
br.PreviousShaURL = fmt.Sprintf("%s/blame/commit/%s/%s", repoLink, previousSha, ctx.Repo.TreePath)
241240
br.CommitURL = fmt.Sprintf("%s/commit/%s", repoLink, part.Sha)
242-
br.CommitMessage = html.EscapeString(commit.CommitMessage)
241+
br.CommitMessage = commit.CommitMessage
243242
br.CommitSince = commitSince
244243
}
245244

0 commit comments

Comments
 (0)