Browse Source

removed incorrect usage of gsub! which was returning nil if the substitution was not found. Now strips leading and trailing whitespace

unreleased_contents
Brandon Mathis 13 years ago
parent
commit
ae51fe859e
  1. 2
      plugins/code_block.rb

2
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

Loading…
Cancel
Save