diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 069e7372..be4483cf 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -562,7 +562,7 @@ module Linguist # # Returns html String def colorize(options = {}) - return if !text? || large? + return if !text? || large? || generated? options[:options] ||= {} options[:options][:encoding] ||= encoding lexer.highlight(data, options) @@ -575,7 +575,6 @@ module Linguist # # Returns html String def colorize_without_wrapper(options = {}) - return if !text? || large? if text = colorize(options) text[%r{
(.*?)
\s*
}m, 1] else diff --git a/test/test_blob.rb b/test/test_blob.rb index 56cd7f5e..adcdd226 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -431,4 +431,8 @@ class TestBlob < Test::Unit::TestCase end HTML end + + def test_colorize_skips_minified_files + assert_nil blob("jquery-1.6.1.min.js").colorize + end end