Skip to content

Commit e53b26a

Browse files
committed
updated plugins to work with latest version of Liquid
1 parent 2a55f35 commit e53b26a

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

plugins/blockquote.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def initialize(tag_name, markup, tokens)
4646
end
4747

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

7777
def paragraphize(input)
78-
"<p>#{input.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
78+
"<p>#{input.lstrip.rstrip.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
7979
end
8080
end
8181
end

plugins/code_block.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def initialize(tag_name, markup, tokens)
7979

8080
def render(context)
8181
output = super
82-
code = super.join
82+
code = super
8383
source = "<figure class='code'>"
8484
source += @caption if @caption
8585
if @filetype

plugins/pullquote.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ def initialize(tag_name, markup, tokens)
3232

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

0 commit comments

Comments
 (0)