Only pass first class to Pygments
This prevents an exception if something like the following is used: ~~~ {foo bar} some code ~~~
This commit is contained in:
parent
a78b587e25
commit
38ac55381b
|
@ -15,7 +15,7 @@ module Jekyll
|
|||
|
||||
@renderer ||= Class.new(Redcarpet::Render::HTML) do
|
||||
def block_code(code, lang)
|
||||
lang ||= 'text'
|
||||
lang = lang && lang.split.first || "text"
|
||||
output = add_code_tags(
|
||||
Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }),
|
||||
lang
|
||||
|
|
Loading…
Reference in New Issue