Browse code

Merge branch 'master' of github.com:imathis/octopress

Brandon Mathis authored on 29/09/2011 at 19:53:45
Showing 1 changed files
... ...
@@ -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!