Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated plugins to work with latest version of Liquid

  • Loading branch information...
commit e53b26ad3042d5657c869ab1961c35e7b716e4e9 1 parent 2a55f35
@imathis imathis authored
View
4 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 = "<strong>#{@by.strip}</strong>" if @by
if @source
url = @source.match(/https?:\/\/(.+)/)[1].split('/')
@@ -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
View
2  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 = "<figure class='code'>"
source += @caption if @caption
if @filetype
View
6 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)
- "<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
Please sign in to comment.
Something went wrong with that request. Please try again.