Browse code

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

Brandon Mathis authored on 20/07/2011 at 15:01:34
Showing 1 changed files
... ...
@@ -67,7 +67,7 @@ module Jekyll
67 67
       if @filetype
68 68
         source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}</figure></div>"
69 69
       else
70
-        source += "<pre><code>" + code.gsub!(/</,'&lt;') + "</code></pre></figure></div>"
70
+        source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"
71 71
       end
72 72
       partial = Liquid::Template.parse(source)
73 73
       context.stack do