diff options
author | Unknwon <u@gogs.io> | 2016-02-07 11:49:11 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-07 11:49:11 -0500 |
commit | f15a2f9b25bbec130915fec5b33c7e49dc7cf57d (patch) | |
tree | 1ba3aa079c4f931a6fef87693cf83e731a323bcc /routers/repo/view.go | |
parent | 3b102a71a2cef4a3cdb748bbc6e0499fdec5e3b4 (diff) | |
parent | 2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1 (diff) |
Merge pull request #2528 from andreynering/diff-sintax-highlight-733
Enable syntax highlighting on diff view
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r-- | routers/repo/view.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 25e312b1..6a4ad646 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -19,6 +19,7 @@ import ( "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/template" + "github.com/gogits/gogs/modules/template/highlight" ) const ( @@ -79,7 +80,7 @@ func Home(ctx *middleware.Context) { ctx.Data["FileSize"] = blob.Size() ctx.Data["IsFile"] = true ctx.Data["FileName"] = blob.Name() - ctx.Data["HighlightClass"] = template.FileNameToHighlightClass(blob.Name()) + ctx.Data["HighlightClass"] = highlight.FileNameToHighlightClass(blob.Name()) ctx.Data["FileLink"] = rawLink + "/" + treename buf := make([]byte, 1024) |