aboutsummaryrefslogtreecommitdiffstats
path: root/modules/highlight/highlight.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/highlight/highlight.go')
-rw-r--r--modules/highlight/highlight.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index d7ab3f7afd..77f24fa3f3 100644
--- a/modules/highlight/highlight.go
+++ b/modules/highlight/highlight.go
@@ -11,6 +11,7 @@ import (
gohtml "html"
"html/template"
"io"
+ "path"
"path/filepath"
"strings"
"sync"
@@ -83,7 +84,7 @@ func Code(fileName, language, code string) (output template.HTML, lexerName stri
}
if lexer == nil {
- if val, ok := highlightMapping[filepath.Ext(fileName)]; ok {
+ if val, ok := highlightMapping[path.Ext(fileName)]; ok {
// use mapped value to find lexer
lexer = lexers.Get(val)
}