diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-29 14:53:45 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-29 14:53:45 -0500 |
commit | 30d5bfca9ced5f9a5ac6a8d2c8117cf8cbafe30a (patch) | |
tree | 99c676f6128f97d7af1a52c07ccae1bd97222802 /plugins/titlecase.rb | |
parent | b19e7698f671ee9cde9c1015b77a7555ecfadbd1 (diff) | |
parent | a35c7806165a0e9ea04883480a91a8851a5751a9 (diff) | |
download | my_new_personal_website-30d5bfca9ced5f9a5ac6a8d2c8117cf8cbafe30a.tar.xz my_new_personal_website-30d5bfca9ced5f9a5ac6a8d2c8117cf8cbafe30a.zip |
Merge branch 'master' of github.com:imathis/octopress
Diffstat (limited to 'plugins/titlecase.rb')
-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! |