File tree 3 files changed +8
-2
lines changed 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 {
224
224
return "Plaintext"
225
225
}
226
226
227
- return util .ToTitleCase (name )
227
+ return util .ToTitleCaseNoLower (name )
228
228
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func TestFile(t *testing.T) {
32
32
name : "empty.js" ,
33
33
code : "" ,
34
34
want : lines ("" ),
35
- lexerName : "Javascript " ,
35
+ lexerName : "JavaScript " ,
36
36
},
37
37
{
38
38
name : "tags.txt" ,
Original file line number Diff line number Diff line change @@ -187,12 +187,18 @@ func ToUpperASCII(s string) string {
187
187
}
188
188
189
189
var titleCaser = cases .Title (language .English )
190
+ var titleCaserNoLower = cases .Title (language .English , cases .NoLower )
190
191
191
192
// ToTitleCase returns s with all english words capitalized
192
193
func ToTitleCase (s string ) string {
193
194
return titleCaser .String (s )
194
195
}
195
196
197
+ // ToTitleCaseNoLower returns s with all english words capitalized without lowercasing
198
+ func ToTitleCaseNoLower (s string ) string {
199
+ return titleCaserNoLower .String (s )
200
+ }
201
+
196
202
var (
197
203
whitespaceOnly = regexp .MustCompile ("(?m)^[ \t ]+$" )
198
204
leadingWhitespace = regexp .MustCompile ("(?m)(^[ \t ]*)(?:[^ \t \n ])" )
You can’t perform that action at this time.
0 commit comments