From a71a709cb320a5eef92251298c90ac735e34d45c Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 19 Jul 2011 16:32:57 -0400 Subject: [PATCH] Fixed a bug where blockquotes broke without an author, also refactored a bit for reability --- plugins/blockquote.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index d292ce8..e6388db 100644 --- a/plugins/blockquote.rb +++ b/plugins/blockquote.rb @@ -41,8 +41,8 @@ module Jekyll end def render(context) - output = paragraphize(super.map(&:strip).join) - author = "#{@by.strip}" + quote = paragraphize(super.map(&:strip).join) + author = "#{@by.strip}" if @by if @source url = @source.match(/https?:\/\/(.+)/)[1].split('/') parts = [] @@ -55,14 +55,14 @@ module Jekyll source << '/…' unless source == @source end cite = "#{(@title || source)}" - result = if @by.nil? - output + quote_only = if @by.nil? + quote elsif !@source.nil? - "#{output}" + "#{quote}" else - "#{output}" + "#{quote}" end - "
#{result}
" + "
#{quote_only}
" end def paragraphize(input)