File tree Expand file tree Collapse file tree
scriptshifter/hooks/general Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ def capitalize_post_assembly(ctx):
4545 return " " .join (dest_ls )
4646
4747
48-
4948def normalize_spacing_post_assembly (ctx ):
5049 """
5150 Remove duplicate and unwanted whitespace around punctuation.
@@ -76,14 +75,17 @@ def normalize_spacing_post_assembly(ctx):
7675
7776def _capitalize (src , which ):
7877 """
79- Only capitalize first word and words preceded by space .
78+ capitalize first word only or all words .
8079
8180 NOTE: this function is only used for capitalizing hook-generated
8281 transliterations, which are not normally processed. Double cap rules are
8382 not applicable here.
8483 """
8584 if which == "first" :
86- ctx .dest_ls [0 ] = ctx .dest_ls [0 ].upper ()
85+ src [0 ] = src [0 ].capitalize ()
86+ return src
87+
88+ if which == "all" :
89+ return [tk [0 ].upper () + tk [1 :] for tk in src ]
8790
88- elif which == "all" :
89- ctx .dest_ls = [tk [0 ].upper () + tk [1 :] for tk in ctx .dest_ls ]
91+ return src
You can’t perform that action at this time.
0 commit comments