Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updated plugins to work with latest version of Liquid
  • Loading branch information
imathis committed May 24, 2012
1 parent 2a55f35 commit e53b26a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugins/blockquote.rb
Expand Up @@ -46,7 +46,7 @@ def initialize(tag_name, markup, tokens)
end

def render(context)
quote = paragraphize(super.map(&:strip).join)
quote = paragraphize(super)
author = "<strong>#{@by.strip}</strong>" if @by
if @source
url = @source.match(/https?:\/\/(.+)/)[1].split('/')
Expand Down Expand Up @@ -75,7 +75,7 @@ def render(context)
end

def paragraphize(input)
"<p>#{input.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
"<p>#{input.lstrip.rstrip.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/code_block.rb
Expand Up @@ -79,7 +79,7 @@ def initialize(tag_name, markup, tokens)

def render(context)
output = super
code = super.join
code = super
source = "<figure class='code'>"
source += @caption if @caption
if @filetype
Expand Down
6 changes: 2 additions & 4 deletions plugins/pullquote.rb
Expand Up @@ -32,11 +32,9 @@ def initialize(tag_name, markup, tokens)

def render(context)
output = super
if output.join =~ /\{"\s*(.+)\s*"\}/
#@quote = $1
if output =~ /\{"\s*(.+?)\s*"\}/m
@quote = RubyPants.new($1).to_html
#@quote = CGI.escape($1)
"<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
"<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.gsub(/\{"\s*|\s*"\}/, '')}</span>"
else
return "Surround your pullquote like this {\" text to be quoted \"}"
end
Expand Down

0 comments on commit e53b26a

Please sign in to comment.