diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-07-19 16:32:57 -0400 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-07-19 16:32:57 -0400 |
commit | a71a709cb320a5eef92251298c90ac735e34d45c (patch) | |
tree | 53da1451be5c7029554d9e8521b5d035fbc51627 /plugins | |
parent | 98cfd74d9ac6a02113f950c2f2cf4772b15bdff1 (diff) | |
download | my_new_personal_website-a71a709cb320a5eef92251298c90ac735e34d45c.tar.xz my_new_personal_website-a71a709cb320a5eef92251298c90ac735e34d45c.zip |
Fixed a bug where blockquotes broke without an author, also refactored a bit for reability
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/blockquote.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index d292ce8e..e6388db3 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 = "<strong>#{@by.strip}</strong>" + quote = paragraphize(super.map(&:strip).join) + author = "<strong>#{@by.strip}</strong>" if @by if @source url = @source.match(/https?:\/\/(.+)/)[1].split('/') parts = [] @@ -55,14 +55,14 @@ module Jekyll source << '/…' unless source == @source end cite = "<cite><a href='#{@source}'>#{(@title || source)}</a></cite>" - result = if @by.nil? - output + quote_only = if @by.nil? + quote elsif !@source.nil? - "#{output}<footer>#{author + cite}</footer>" + "#{quote}<footer>#{author + cite}</footer>" else - "#{output}<footer>#{author}</footer>" + "#{quote}<footer>#{author}</footer>" end - "<blockquote>#{result}</blockquote>" + "<blockquote>#{quote_only}</blockquote>" end def paragraphize(input) |