Skip to content

Commit

Permalink
Only pass first class to Pygments
Browse files Browse the repository at this point in the history
This prevents an exception if something like the following is used:

~~~ {foo bar}
some code
~~~
  • Loading branch information
tombell committed Nov 13, 2012
1 parent a78b587 commit 38ac553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jekyll/converters/markdown.rb
Expand Up @@ -15,7 +15,7 @@ def setup

@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
Expand Down

0 comments on commit 38ac553

Please sign in to comment.