mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-06 12:45:16 -05:00
Refactor highlighting
Extract some of the common logic from the renderers.
This commit is contained in:
@@ -65,16 +65,16 @@ CONTENT
|
||||
assert_equal({}, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos ', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ 'linenos' => 'inline' }, tag.instance_variable_get(:@options))
|
||||
assert_equal({ :linenos => 'inline' }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table ', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ 'linenos' => 'table' }, tag.instance_variable_get(:@options))
|
||||
assert_equal({ :linenos => 'table' }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table nowrap', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ 'linenos' => 'table', 'nowrap' => true }, tag.instance_variable_get(:@options))
|
||||
assert_equal({ :linenos => 'table', :nowrap => true }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ 'cssclass' => 'hl', 'linenos' => 'table' }, tag.instance_variable_get(:@options))
|
||||
assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive"
|
||||
|
||||
Reference in New Issue
Block a user