aboutsummaryrefslogtreecommitdiff
path: root/plugins/titlecase.rb
diff options
context:
space:
mode:
authorFrederic Hemberger <mail@frederic-hemberger.de>2011-12-10 03:24:16 -0800
committerFrederic Hemberger <mail@frederic-hemberger.de>2011-12-10 03:24:16 -0800
commitcb61146264315e9e8f0edc56c0117f59a3e8f88d (patch)
treeada18e969ccb1c5657ed68daaf66b36e27cc67ab /plugins/titlecase.rb
parent7f3ad1c1cc40d6598a8d04eb45f146943c120d3b (diff)
parent343e0f140949b9d7be2ab6a489c1edc662868463 (diff)
downloadmy_new_personal_website-cb61146264315e9e8f0edc56c0117f59a3e8f88d.tar.xz
my_new_personal_website-cb61146264315e9e8f0edc56c0117f59a3e8f88d.zip
Merge pull request #295 from jbrains/master
Capitalize word after '!' and '?'.
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 3ad39b1f..7648932c 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 or periods are capitalized
- x.join(" ").gsub(/(:|\.)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " }
+ # small words are capitalized after colon, period, exclamation mark, question mark
+ x.join(" ").gsub(/(:|\.|!|\?)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " }
end
def titlecase!