Skip to content

Commit 63e99df

Browse files
committed
[GITEA] Improve HTML title on repositories (squash) do not double escape
(cherry picked from commit 22882fe25cde57837a31738a10c71c9478e16662)
1 parent 7d2d997 commit 63e99df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/web/repo/view.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
165165

166166
if ctx.Repo.TreePath != "" {
167167
ctx.Data["HideRepoInfo"] = true
168-
ctx.Data["Title"] = ctx.Tr("repo.file.title", ctx.Repo.Repository.Name+"/"+util.PathEscapeSegments(ctx.Repo.TreePath), ctx.Repo.RefName)
168+
ctx.Data["Title"] = ctx.Tr("repo.file.title", ctx.Repo.Repository.Name+"/"+ctx.Repo.TreePath, ctx.Repo.RefName)
169169
}
170170

171171
subfolder, readmeFile, err := findReadmeFileInEntries(ctx, entries, true)
@@ -344,7 +344,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
344344
}
345345
defer dataRc.Close()
346346

347-
ctx.Data["Title"] = ctx.Tr("repo.file.title", ctx.Repo.Repository.Name+"/"+util.PathEscapeSegments(ctx.Repo.TreePath), ctx.Repo.RefName)
347+
ctx.Data["Title"] = ctx.Tr("repo.file.title", ctx.Repo.Repository.Name+"/"+ctx.Repo.TreePath, ctx.Repo.RefName)
348348
ctx.Data["FileIsSymlink"] = entry.IsLink()
349349
ctx.Data["FileName"] = blob.Name()
350350
ctx.Data["RawFileLink"] = rawLink + "/" + util.PathEscapeSegments(ctx.Repo.TreePath)

0 commit comments

Comments
 (0)