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

Conflicts:
	plugins/blockquote.rb
This commit is contained in:
Sean Kerr 2013-01-09 09:24:43 -05:00 committed by Brandon Mathis
parent 1d5b9f803f
commit cfcbd7261a

View File

@ -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