Skip to content

Commit

Permalink
Axe colorize_without_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jun 10, 2013
1 parent 1a53d19 commit b1a1371
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
14 changes: 0 additions & 14 deletions lib/linguist/blob_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,19 +343,5 @@ def colorize(options = {})
options[:options][:encoding] ||= encoding
lexer.highlight(data, options)
end

# Public: Highlight syntax of blob without the outer highlight div
# wrapper.
#
# options - A Hash of options (defaults to {})
#
# Returns html String
def colorize_without_wrapper(options = {})
if text = colorize(options)
text[%r{<div class="highlight"><pre>(.*?)</pre>\s*</div>}m, 1]
else
''
end
end
end
end
7 changes: 0 additions & 7 deletions test/test_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,6 @@ def test_colorize
HTML
end

def test_colorize_without_wrapper
assert_equal <<-HTML, blob("Ruby/foo.rb").colorize_without_wrapper
<span class="k">module</span> <span class="nn">Foo</span>
<span class="k">end</span>
HTML
end

def test_colorize_does_skip_minified_files
assert_nil blob("JavaScript/jquery-1.6.1.min.js").colorize
end
Expand Down

0 comments on commit b1a1371

Please sign in to comment.