summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-16 22:13:12 -0500
committerUnknwon <u@gogs.io>2015-12-16 22:13:12 -0500
commit6673dcb0380aa99da25b4d1d68cf129635fe30d9 (patch)
tree45167c2f2991818467389866847c402e3a48e906 /routers/repo
parent71142929cc35e9b7c73b659c38b5eb42dc42bb83 (diff)
downloadgitea-6673dcb0380aa99da25b4d1d68cf129635fe30d9.tar.gz
gitea-6673dcb0380aa99da25b4d1d68cf129635fe30d9.zip
#2103 #2181 improvments of highlight class name
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/view.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 4ba26a0c4f..191f123454 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -79,11 +79,7 @@ func Home(ctx *middleware.Context) {
ctx.Data["FileSize"] = blob.Size()
ctx.Data["IsFile"] = true
ctx.Data["FileName"] = blob.Name()
- ext := path.Ext(blob.Name())
- if len(ext) > 0 {
- ext = ext[1:]
- }
- ctx.Data["FileExt"] = ext
+ ctx.Data["HighlightClass"] = template.FileNameToHighlightClass(blob.Name())
ctx.Data["FileLink"] = rawLink + "/" + treename
buf := make([]byte, 1024)