Merge pull request #1615 from benbalter/downcase-lexers
Downcase lexers before passing to Pygments
This commit is contained in:
commit
0761769dda
|
@ -14,7 +14,7 @@ module Jekyll
|
||||||
def initialize(tag_name, markup, tokens)
|
def initialize(tag_name, markup, tokens)
|
||||||
super
|
super
|
||||||
if markup.strip =~ SYNTAX
|
if markup.strip =~ SYNTAX
|
||||||
@lang = $1
|
@lang = $1.downcase
|
||||||
@options = {}
|
@options = {}
|
||||||
if defined?($2) && $2 != ''
|
if defined?($2) && $2 != ''
|
||||||
$2.split.each do |opt|
|
$2.split.each do |opt|
|
||||||
|
|
|
@ -69,6 +69,9 @@ CONTENT
|
||||||
|
|
||||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
|
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"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue