mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08: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:
		@@ -19,9 +19,11 @@ var (
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// File names that are representing highlight classes.
 | 
						// File names that are representing highlight classes.
 | 
				
			||||||
	highlightFileNames = map[string]bool{
 | 
						highlightFileNames = map[string]string{
 | 
				
			||||||
		"dockerfile": true,
 | 
							"dockerfile":     "dockerfile",
 | 
				
			||||||
		"makefile":   true,
 | 
							"makefile":       "makefile",
 | 
				
			||||||
 | 
							"gnumakefile":    "makefile",
 | 
				
			||||||
 | 
							"cmakelists.txt": "cmake",
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Extensions that are same as highlight classes.
 | 
						// Extensions that are same as highlight classes.
 | 
				
			||||||
@@ -87,8 +89,8 @@ func FileNameToHighlightClass(fname string) string {
 | 
				
			|||||||
		return "nohighlight"
 | 
							return "nohighlight"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if highlightFileNames[fname] {
 | 
						if name, ok := highlightFileNames[fname]; ok {
 | 
				
			||||||
		return fname
 | 
							return name
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ext := path.Ext(fname)
 | 
						ext := path.Ext(fname)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user