diff --git a/modules/base/template.go b/modules/base/template.go index bc69bb3b3..f0a2e0329 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -178,7 +178,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "Oauth2Name": Oauth2Name, "ToUtf8": ToUtf8, "EscapePound": func(str string) string { - return strings.Replace(str, "#", "%23", -1) + return strings.Replace(strings.Replace(str, "%", "%25", -1), "#", "%23", -1) }, "RenderCommitMessage": RenderCommitMessage, } diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 2cc114edc..7a18ed985 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -48,7 +48,7 @@ {{ $l := Subtract $n 1}} {{range $i, $v := .Treenames}} {{if eq $i $l}} - {{EscapePound $v}} + {{$v}} {{else}} {{$v}} {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index f51c10025..d3303193f 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -50,7 +50,7 @@