···134134 return template.HTML(strings.TrimSuffix(htmlbuf.String(), "\n"))
135135}
136136137137+// For the case where Enry recognizes the language, but doesn't use the naming
138138+// that Chroma expects.
139139+var normalizeEnryToChroma = map[string]string{
140140+ "F#": "FSharp",
141141+}
142142+137143// File returns a slice of chroma syntax highlighted HTML lines of code and the matched lexer name
138144func File(fileName, language string, code []byte) ([]template.HTML, string, error) {
139145 NewContext()
···162168163169 if lexer == nil {
164170 guessLanguage := analyze.GetCodeLanguage(fileName, code)
171171+ if normalizedGuessLanguage, ok := normalizeEnryToChroma[guessLanguage]; ok {
172172+ guessLanguage = normalizedGuessLanguage
173173+ }
165174166175 lexer = lexers.Get(guessLanguage)
167176 if lexer == nil {