From e53b26ad3042d5657c869ab1961c35e7b716e4e9 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 24 May 2012 10:28:32 -0500 Subject: [PATCH] updated plugins to work with latest version of Liquid --- plugins/blockquote.rb | 4 ++-- plugins/code_block.rb | 2 +- plugins/pullquote.rb | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index 7fb8c261753..62e7d143ade 100644 --- a/plugins/blockquote.rb +++ b/plugins/blockquote.rb @@ -46,7 +46,7 @@ def initialize(tag_name, markup, tokens) end def render(context) - quote = paragraphize(super.map(&:strip).join) + quote = paragraphize(super) author = "#{@by.strip}" if @by if @source url = @source.match(/https?:\/\/(.+)/)[1].split('/') @@ -75,7 +75,7 @@ def render(context) end def paragraphize(input) - "

#{input.gsub(/\n\n/, '

').gsub(/\n/, '
')}

" + "

#{input.lstrip.rstrip.gsub(/\n\n/, '

').gsub(/\n/, '
')}

" end end end diff --git a/plugins/code_block.rb b/plugins/code_block.rb index e175d44581a..44e34945ad7 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -79,7 +79,7 @@ def initialize(tag_name, markup, tokens) def render(context) output = super - code = super.join + code = super source = "
" source += @caption if @caption if @filetype diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb index 2b59bad6a5c..3c65e66e88d 100644 --- a/plugins/pullquote.rb +++ b/plugins/pullquote.rb @@ -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) - "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" + "#{output.gsub(/\{"\s*|\s*"\}/, '')}" else return "Surround your pullquote like this {\" text to be quoted \"}" end