mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Enable sintax highlighting on diff view. Close #733
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user