aboutsummaryrefslogtreecommitdiff
path: root/plugins/pullquote.rb
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-12-11 16:20:04 -0600
committerBrandon Mathis <brandon@imathis.com>2011-12-11 16:24:39 -0600
commitd5a02a78f650689c8fe9e070233814cc5e428aec (patch)
tree84e8e0db0ce6a11ad0b0472e7792fd830ce87dd0 /plugins/pullquote.rb
parent39ec55b6057257a2d2fba4ca25eb58e5c5ef234c (diff)
downloadmy_new_personal_website-d5a02a78f650689c8fe9e070233814cc5e428aec.tar.xz
my_new_personal_website-d5a02a78f650689c8fe9e070233814cc5e428aec.zip
Added RubyPants (the ruby port of John Gruber's smarty pants) to intelligently replace primes with smart quotes in the pullquote plugin, fixes #316
Diffstat (limited to '')
-rw-r--r--plugins/pullquote.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb
index cf8d22f1..2b59bad6 100644
--- a/plugins/pullquote.rb
+++ b/plugins/pullquote.rb
@@ -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 \"}"