| ... | ... |
@@ -46,7 +46,7 @@ module Jekyll |
| 46 | 46 |
end |
| 47 | 47 |
|
| 48 | 48 |
def render(context) |
| 49 |
- quote = paragraphize(super.map(&:strip).join) |
|
| 49 |
+ quote = paragraphize(super) |
|
| 50 | 50 |
author = "<strong>#{@by.strip}</strong>" if @by
|
| 51 | 51 |
if @source |
| 52 | 52 |
url = @source.match(/https?:\/\/(.+)/)[1].split('/')
|
| ... | ... |
@@ -75,7 +75,7 @@ module Jekyll |
| 75 | 75 |
end |
| 76 | 76 |
|
| 77 | 77 |
def paragraphize(input) |
| 78 |
- "<p>#{input.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
|
|
| 78 |
+ "<p>#{input.lstrip.rstrip.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
|
|
| 79 | 79 |
end |
| 80 | 80 |
end |
| 81 | 81 |
end |
| ... | ... |
@@ -32,11 +32,9 @@ module Jekyll |
| 32 | 32 |
|
| 33 | 33 |
def render(context) |
| 34 | 34 |
output = super |
| 35 |
- if output.join =~ /\{"\s*(.+)\s*"\}/
|
|
| 36 |
- #@quote = $1 |
|
| 35 |
+ if output =~ /\{"\s*(.+?)\s*"\}/m
|
|
| 37 | 36 |
@quote = RubyPants.new($1).to_html |
| 38 |
- #@quote = CGI.escape($1) |
|
| 39 |
- "<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
|
|
| 37 |
+ "<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.gsub(/\{"\s*|\s*"\}/, '')}</span>"
|
|
| 40 | 38 |
else |
| 41 | 39 |
return "Surround your pullquote like this {\" text to be quoted \"}"
|
| 42 | 40 |
end |