mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-07 20:08:48 +00:00
Do not reset options when calling highlight
This commit is contained in:
@@ -485,7 +485,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns html String
|
# Returns html String
|
||||||
def colorize(text, options = {})
|
def colorize(text, options = {})
|
||||||
lexer.highlight(text, options = {})
|
lexer.highlight(text, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Return name as String representation
|
# 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>
|
<div class="highlight"><pre><span class="k">def</span> <span class="nf">foo</span>
|
||||||
<span class="s1">'foo'</span>
|
<span class="s1">'foo'</span>
|
||||||
<span class="k">end</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>
|
</pre></div>
|
||||||
HTML
|
HTML
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user