diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-28 13:35:42 -0700 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-28 13:35:42 -0700 |
commit | a35c7806165a0e9ea04883480a91a8851a5751a9 (patch) | |
tree | 8ee8f76d111625208795c75605f70a145584403b /plugins/titlecase.rb | |
parent | 3bd4ed026eab04b5c560ca85317c982ab0679369 (diff) | |
parent | f75f17b05c1236dfa2fa0bd059a32e3232b69ac3 (diff) | |
download | my_new_personal_website-a35c7806165a0e9ea04883480a91a8851a5751a9.tar.xz my_new_personal_website-a35c7806165a0e9ea04883480a91a8851a5751a9.zip |
Merge pull request #180 from victor/patch-1
Allow capitalization after a period.
Diffstat (limited to '')
-rw-r--r-- | plugins/titlecase.rb | 4 |
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! |