mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-10 12:12:32 +02:00
Fix specific highlighting (CMakeLists.txt ...) (#7686)
* Fix specific highlighting. * Highlighting CMakeLists.txt: remove case sensitive checks. use lowercase checks instead.
This commit is contained in:
parent
09463d17e4
commit
0e887af2d1
1 changed files with 7 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue