Browse code

Fixed blockquote plugin (author alone would not show up without title)

Sean Kerr authored on 09/01/2013 at 14:24:43
Showing 1 changed files
... ...
@@ -21,6 +21,7 @@ module Jekyll
21 21
   class Blockquote < Liquid::Block
22 22
     FullCiteWithTitle = /(\S.*)\s+(https?:\/\/)(\S+)\s+(.+)/i
23 23
     FullCite = /(\S.*)\s+(https?:\/\/)(\S+)/i
24
+    AuthorTitle = /([^,]+),([^,]+)/
24 25
     Author =  /(.+)/
25 26
 
26 27
     def initialize(tag_name, markup, tokens)
... ...
@@ -34,13 +35,11 @@ module Jekyll
34 34
       elsif markup =~ FullCite
35 35
         @by = $1
36 36
         @source = $2 + $3
37
+      elsif markup =~ AuthorTitle
38
+        @by = $1
39
+        @title = $2.titlecase
37 40
       elsif markup =~ Author
38
-        if $1 =~ /([^,]+),([^,]+)/
39
-          @by = $1
40
-          @title = $2.titlecase
41
-        else
42
-          @by = $1
43
-        end
41
+        @by = $1
44 42
       end
45 43
       super
46 44
     end