Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions modules/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down