From cfcbd7261a3b40016f997d58d523b614eb4bb4c7 Mon Sep 17 00:00:00 2001 From: Sean Kerr Date: Wed, 9 Jan 2013 09:24:43 -0500 Subject: [PATCH] Fixed blockquote plugin (author alone would not show up without title) Conflicts: plugins/blockquote.rb --- plugins/blockquote.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index bdb211a..e95282e 100644 --- a/plugins/blockquote.rb +++ b/plugins/blockquote.rb @@ -21,6 +21,7 @@ module Jekyll class Blockquote < Liquid::Block FullCiteWithTitle = /(\S.*)\s+(https?:\/\/)(\S+)\s+(.+)/i FullCite = /(\S.*)\s+(https?:\/\/)(\S+)/i + AuthorTitle = /([^,]+),([^,]+)/ Author = /(.+)/ def initialize(tag_name, markup, tokens) @@ -30,17 +31,15 @@ module Jekyll if markup.strip =~ FullCiteWithTitle @by = $1 @source = $2 + $3 - @title = $4.titlecase + @title = $4.titlecase.strip elsif markup.strip =~ FullCite @by = $1 @source = $2 + $3 + elsif markup.strip =~ AuthorTitle + @by = $1 + @title = $2.titlecase.strip elsif markup.strip =~ Author - if $1 =~ /([^,]+),([^,]+)/ - @by = $1 - @title = $2.titlecase - else - @by = markup - end + @by = $1 end super end