File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -224,5 +224,5 @@ func formatLexerName(name string) string {
224224 return "Plaintext"
225225 }
226226
227- return util .ToTitleCase (name )
227+ return util .ToTitleCaseNoLower (name )
228228}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func TestFile(t *testing.T) {
3232 name : "empty.js" ,
3333 code : "" ,
3434 want : lines ("" ),
35- lexerName : "Javascript " ,
35+ lexerName : "JavaScript " ,
3636 },
3737 {
3838 name : "tags.txt" ,
Original file line number Diff line number Diff line change @@ -187,12 +187,18 @@ func ToUpperASCII(s string) string {
187187}
188188
189189var titleCaser = cases .Title (language .English )
190+ var titleCaserNoLower = cases .Title (language .English , cases .NoLower )
190191
191192// ToTitleCase returns s with all english words capitalized
192193func ToTitleCase (s string ) string {
193194 return titleCaser .String (s )
194195}
195196
197+ // ToTitleCaseNoLower returns s with all english words capitalized without lowercasing
198+ func ToTitleCaseNoLower (s string ) string {
199+ return titleCaserNoLower .String (s )
200+ }
201+
196202var (
197203 whitespaceOnly = regexp .MustCompile ("(?m)^[ \t ]+$" )
198204 leadingWhitespace = regexp .MustCompile ("(?m)(^[ \t ]*)(?:[^ \t \n ])" )
You can’t perform that action at this time.
0 commit comments