Skip to content

Commit 0e887af

Browse files
FlorianBenlunny
authored andcommitted
Fix specific highlighting (CMakeLists.txt ...) (#7686)
* Fix specific highlighting. * Highlighting CMakeLists.txt: remove case sensitive checks. use lowercase checks instead.
1 parent 09463d1 commit 0e887af

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

modules/highlight/highlight.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ var (
1919
}
2020

2121
// File names that are representing highlight classes.
22-
highlightFileNames = map[string]bool{
23-
"dockerfile": true,
24-
"makefile": true,
22+
highlightFileNames = map[string]string{
23+
"dockerfile": "dockerfile",
24+
"makefile": "makefile",
25+
"gnumakefile": "makefile",
26+
"cmakelists.txt": "cmake",
2527
}
2628

2729
// Extensions that are same as highlight classes.
@@ -87,8 +89,8 @@ func FileNameToHighlightClass(fname string) string {
8789
return "nohighlight"
8890
}
8991

90-
if highlightFileNames[fname] {
91-
return fname
92+
if name, ok := highlightFileNames[fname]; ok {
93+
return name
9294
}
9395

9496
ext := path.Ext(fname)

0 commit comments

Comments
 (0)