Browse code

Fixed a bug where blockquotes broke without an author, also refactored a bit for reability

Brandon Mathis authored on 19/07/2011 at 20:32:57
Showing 1 changed files
... ...
@@ -41,8 +41,8 @@ module Jekyll
41 41
     end
42 42
 
43 43
     def render(context)
44
-      output = paragraphize(super.map(&:strip).join)
45
-      author = "<strong>#{@by.strip}</strong>"
44
+      quote = paragraphize(super.map(&:strip).join)
45
+      author = "<strong>#{@by.strip}</strong>" if @by
46 46
       if @source
47 47
         url = @source.match(/https?:\/\/(.+)/)[1].split('/')
48 48
         parts = []
... ...
@@ -55,14 +55,14 @@ module Jekyll
55 55
         source << '/&hellip;' unless source == @source
56 56
       end
57 57
       cite = "<cite><a href='#{@source}'>#{(@title || source)}</a></cite>"
58
-      result = if @by.nil?
59
-        output
58
+      quote_only = if @by.nil?
59
+        quote
60 60
       elsif !@source.nil?
61
-        "#{output}<footer>#{author + cite}</footer>"
61
+        "#{quote}<footer>#{author + cite}</footer>"
62 62
       else
63
-        "#{output}<footer>#{author}</footer>"
63
+        "#{quote}<footer>#{author}</footer>"
64 64
       end
65
-      "<blockquote>#{result}</blockquote>"
65
+      "<blockquote>#{quote_only}</blockquote>"
66 66
     end
67 67
 
68 68
     def paragraphize(input)