summaryrefslogtreecommitdiffstats
path: root/modules/highlight
diff options
context:
space:
mode:
authorFlorianBen <FlorianBen@users.noreply.github.com>2019-08-04 10:11:27 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-08-04 16:11:27 +0800
commit0e887af2d16740798a1ced5f6af0b58bd070c40b (patch)
tree1dedca1d71bd2c50a413b063bdd95e2e7c6c7a71 /modules/highlight
parent09463d17e4370f1826a4573e0e741daff2a7b80e (diff)
downloadgitea-0e887af2d16740798a1ced5f6af0b58bd070c40b.tar.gz
gitea-0e887af2d16740798a1ced5f6af0b58bd070c40b.zip
Fix specific highlighting (CMakeLists.txt ...) (#7686)
* Fix specific highlighting. * Highlighting CMakeLists.txt: remove case sensitive checks. use lowercase checks instead.
Diffstat (limited to 'modules/highlight')
-rw-r--r--modules/highlight/highlight.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index cb52f6ac2e..4334480566 100644
--- a/modules/highlight/highlight.go
+++ b/modules/highlight/highlight.go
@@ -19,9 +19,11 @@ var (
}
// File names that are representing highlight classes.
- highlightFileNames = map[string]bool{
- "dockerfile": true,
- "makefile": true,
+ highlightFileNames = map[string]string{
+ "dockerfile": "dockerfile",
+ "makefile": "makefile",
+ "gnumakefile": "makefile",
+ "cmakelists.txt": "cmake",
}
// Extensions that are same as highlight classes.
@@ -87,8 +89,8 @@ func FileNameToHighlightClass(fname string) string {
return "nohighlight"
}
- if highlightFileNames[fname] {
- return fname
+ if name, ok := highlightFileNames[fname]; ok {
+ return name
}
ext := path.Ext(fname)