Skip to content

Commit

Permalink
Added RubyPants (the ruby port of John Gruber's smarty pants) to inte…
Browse files Browse the repository at this point in the history
…lligently replace primes with smart quotes in the pullquote plugin, fixes imathis#316
  • Loading branch information
imathis committed Dec 11, 2011
1 parent 39ec55b commit d5a02a7
Show file tree
Hide file tree
Showing 2 changed files with 493 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/pullquote.rb
Expand Up @@ -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.
Expand Down Expand Up @@ -33,7 +33,9 @@ def initialize(tag_name, markup, tokens)
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 \"}"
Expand Down

0 comments on commit d5a02a7

Please sign in to comment.