aboutsummaryrefslogtreecommitdiff
path: root/plugins/code_block.rb
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-07-20 11:01:34 -0400
committerBrandon Mathis <brandon@imathis.com>2011-07-20 11:01:56 -0400
commitae51fe859e832c90866204c6cda93f85ebef6543 (patch)
treeaa07ff23459d808e3d600a5b783f4e7779fdde85 /plugins/code_block.rb
parent3587076aed88a19246ffc7bfeeddde96bb6b38a0 (diff)
downloadmy_new_personal_website-ae51fe859e832c90866204c6cda93f85ebef6543.tar.xz
my_new_personal_website-ae51fe859e832c90866204c6cda93f85ebef6543.zip
removed incorrect usage of gsub! which was returning nil if the substitution was not found. Now strips leading and trailing whitespace
Diffstat (limited to 'plugins/code_block.rb')
-rw-r--r--plugins/code_block.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb
index d204e1bd..8c308f21 100644
--- a/plugins/code_block.rb
+++ b/plugins/code_block.rb
@@ -67,7 +67,7 @@ module Jekyll
if @filetype
source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}</figure></div>"
else
- source += "<pre><code>" + code.gsub!(/</,'&lt;') + "</code></pre></figure></div>"
+ source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"
end
partial = Liquid::Template.parse(source)
context.stack do