mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Preserve new lines for syntax highlighting
This commit is contained in:
@@ -457,6 +457,16 @@ Hello
|
||||
assert_equal <<-HTML, Language['Ruby'].colorize_without_wrapper("def foo\n 'foo'\nend\n")
|
||||
<span class="k">def</span> <span class="nf">foo</span>
|
||||
<span class="s1">'foo'</span>
|
||||
<span class="k">end</span>
|
||||
HTML
|
||||
end
|
||||
|
||||
def test_colorize_doesnt_strip_newlines
|
||||
assert_equal <<-HTML, Language['Ruby'].colorize_without_wrapper("\n\n# Foo\ndef 'foo'\nend\n")
|
||||
|
||||
|
||||
<span class="c1"># Foo</span>
|
||||
<span class="k">def</span> <span class="s1">'foo'</span>
|
||||
<span class="k">end</span>
|
||||
HTML
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user