aboutsummaryrefslogtreecommitdiff
path: root/plugins/titlecase.rb
diff options
context:
space:
mode:
authorVictor Jalencas <victor+github@carotena.net>2011-09-28 10:08:55 +0300
committerVictor Jalencas <victor+github@carotena.net>2011-09-28 10:08:55 +0300
commitf75f17b05c1236dfa2fa0bd059a32e3232b69ac3 (patch)
tree1af1099d621965b535edc88a2b56f69d2d3791e3 /plugins/titlecase.rb
parent9cf956cc96d0a337562a46bb1e695c4da31c88c4 (diff)
downloadmy_new_personal_website-f75f17b05c1236dfa2fa0bd059a32e3232b69ac3.tar.xz
my_new_personal_website-f75f17b05c1236dfa2fa0bd059a32e3232b69ac3.zip
Allow capitalization after a period.
Diffstat (limited to 'plugins/titlecase.rb')
-rw-r--r--plugins/titlecase.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/titlecase.rb b/plugins/titlecase.rb
index 103bf702..3ad39b1f 100644
--- a/plugins/titlecase.rb
+++ b/plugins/titlecase.rb
@@ -11,8 +11,8 @@ class String
# capitalize first and last words
x.first.to_s.smart_capitalize!
x.last.to_s.smart_capitalize!
- # small words after colons are capitalized
- x.join(" ").gsub(/:\s?(\W*#{small_words.join("|")}\W*)\s/) { ": #{$1.smart_capitalize} " }
+ # small words after colons or periods are capitalized
+ x.join(" ").gsub(/(:|\.)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " }
end
def titlecase!