Added RubyPants (the ruby port of John Gruber's smarty pants) to intelligently replace primes with smart quotes in the pullquote plugin, fixes #316

This commit is contained in:
Brandon Mathis 2011-12-11 16:20:04 -06:00
parent 39ec55b605
commit d5a02a78f6
2 changed files with 493 additions and 2 deletions

View file

@ -4,7 +4,7 @@
#
# Outputs a span with a data-pullquote attribute set from the marked pullquote. Example:
#
# {% pullquote %}
# {% pullquote %}
# When writing longform posts, I find it helpful to include pullquotes, which help those scanning a post discern whether or not a post is helpful.
# It is important to note, {" pullquotes are merely visual in presentation and should not appear twice in the text. "} That is why it is prefered
# to use a CSS only technique for styling pullquotes.
@ -33,7 +33,9 @@ module Jekyll
def render(context)
output = super
if output.join =~ /\{"\s*(.+)\s*"\}/
@quote = $1
#@quote = $1
@quote = RubyPants.new($1).to_html
#@quote = CGI.escape($1)
"<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
else
return "Surround your pullquote like this {\" text to be quoted \"}"