Allow capitalization after a period.
Brandon Mathis authored on 28/09/2011 at 20:35:42... | ... |
@@ -11,8 +11,8 @@ class String |
11 | 11 |
# capitalize first and last words |
12 | 12 |
x.first.to_s.smart_capitalize! |
13 | 13 |
x.last.to_s.smart_capitalize! |
14 |
- # small words after colons are capitalized |
|
15 |
- x.join(" ").gsub(/:\s?(\W*#{small_words.join("|")}\W*)\s/) { ": #{$1.smart_capitalize} " } |
|
14 |
+ # small words after colons or periods are capitalized |
|
15 |
+ x.join(" ").gsub(/(:|\.)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " } |
|
16 | 16 |
end |
17 | 17 |
|
18 | 18 |
def titlecase! |