mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 04:18:48 +00:00
Do not reset options when calling highlight
This commit is contained in:
@@ -485,7 +485,7 @@ module Linguist
|
||||
#
|
||||
# Returns html String
|
||||
def colorize(text, options = {})
|
||||
lexer.highlight(text, options = {})
|
||||
lexer.highlight(text, options)
|
||||
end
|
||||
|
||||
# Public: Return name as String representation
|
||||
|
||||
@@ -384,6 +384,15 @@ class TestLanguage < Test::Unit::TestCase
|
||||
<div class="highlight"><pre><span class="k">def</span> <span class="nf">foo</span>
|
||||
<span class="s1">'foo'</span>
|
||||
<span class="k">end</span>
|
||||
</pre></div>
|
||||
HTML
|
||||
end
|
||||
|
||||
def test_colorize_with_options
|
||||
assert_equal <<-HTML.chomp, Language['Ruby'].colorize("def foo\n 'foo'\nend\n", :options => { :cssclass => "highlight highlight-ruby" })
|
||||
<div class="highlight highlight-ruby"><pre><span class="k">def</span> <span class="nf">foo</span>
|
||||
<span class="s1">'foo'</span>
|
||||
<span class="k">end</span>
|
||||
</pre></div>
|
||||
HTML
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user