Skip to content

Commit d5a02a7

Browse files
committed
Added RubyPants (the ruby port of John Gruber's smarty pants) to intelligently replace primes with smart quotes in the pullquote plugin, fixes #316
1 parent 39ec55b commit d5a02a7

File tree

2 files changed

+493
-2
lines changed

2 files changed

+493
-2
lines changed

plugins/pullquote.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Outputs a span with a data-pullquote attribute set from the marked pullquote. Example:
66
#
7-
# {% pullquote %}
7+
# {% pullquote %}
88
# 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.
99
# 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
1010
# to use a CSS only technique for styling pullquotes.
@@ -33,7 +33,9 @@ def initialize(tag_name, markup, tokens)
3333
def render(context)
3434
output = super
3535
if output.join =~ /\{"\s*(.+)\s*"\}/
36-
@quote = $1
36+
#@quote = $1
37+
@quote = RubyPants.new($1).to_html
38+
#@quote = CGI.escape($1)
3739
"<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
3840
else
3941
return "Surround your pullquote like this {\" text to be quoted \"}"

0 commit comments

Comments
 (0)