diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index d535a390..5995b765 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -7,6 +7,7 @@ import ( "html/template" "log" "math" + "net/url" "path/filepath" "reflect" "strings" @@ -180,6 +181,10 @@ func funcMap() template.FuncMap { }, "cssContentHash": CssContentHash, "fileTree": filetree.FileTree, + "pathUnescape": func(s string) string { + u, _ := url.PathUnescape(s) + return u + }, } } diff --git a/appview/pages/templates/repo/blob.html b/appview/pages/templates/repo/blob.html index 3f51345c..ff4fce50 100644 --- a/appview/pages/templates/repo/blob.html +++ b/appview/pages/templates/repo/blob.html @@ -24,12 +24,12 @@ {{ index . 0 }}{{ pathUnescape (index . 0) }} / {{ else }} {{ index . 0 }}{{ pathUnescape (index . 0) }} {{ end }} {{ end }} diff --git a/appview/pages/templates/repo/tree.html b/appview/pages/templates/repo/tree.html index bd0980b0..118e8a17 100644 --- a/appview/pages/templates/repo/tree.html +++ b/appview/pages/templates/repo/tree.html @@ -1,4 +1,4 @@ -{{ define "title"}}{{ range .BreadCrumbs }}{{ index . 0}}/{{ end }} at {{ .Ref }} · {{ .RepoInfo.FullName }}{{ end }} +{{ define "title"}}{{ range .BreadCrumbs }}{{ pathUnescape (index . 0)}}/{{ end }} at {{ .Ref }} · {{ .RepoInfo.FullName }}{{ end }} {{ define "extrameta" }} @@ -26,7 +26,7 @@