mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 01:38:24 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user