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

This commit is contained in:
Brandon Mathis 2011-07-20 11:01:34 -04:00
parent 3587076aed
commit ae51fe859e

View File

@ -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