From 38ac55381b6342a3862fe0c353149f2344cdae90 Mon Sep 17 00:00:00 2001 From: Tom Bell Date: Tue, 13 Nov 2012 07:59:36 +0000 Subject: [PATCH] Only pass first class to Pygments This prevents an exception if something like the following is used: ~~~ {foo bar} some code ~~~ --- lib/jekyll/converters/markdown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb index 67f7a06b..3c6ba539 100644 --- a/lib/jekyll/converters/markdown.rb +++ b/lib/jekyll/converters/markdown.rb @@ -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