Code hilighter needs to handle blanks lines.

This commit is contained in:
Tom Preston-Werner
2010-07-29 21:57:30 -04:00
parent f23d093d6f
commit 38b8700651
2 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ module Gollum
@codemap.each do |id, spec|
lang = spec[:lang]
code = spec[:code]
if code.all? { |line| line =~ /^( |\t)/ }
if code.all? { |line| line =~ /\A\r?\n\Z/ || line =~ /^( |\t)/ }
code.gsub!(/^( |\t)/m, '')
end
data.gsub!(id, Gollum::Albino.new(code, lang).colorize)