From 2b2e027b34a60cbb438dd048a4a532858cd5bbe6 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Wed, 13 Jan 2010 21:30:45 -0800 Subject: [PATCH] Render highlighted code for non markdown/textile pages. Fixes #116 --- History.txt | 4 ++++ lib/jekyll/tags/highlight.rb | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/History.txt b/History.txt index 07e3efee..8c821b9b 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,7 @@ +== Edge + * Bug Fixes + * Render highlighted code for non markdown/textile pages (#116) + == 0.5.7 / 2010-01-12 * Minor Enhancements * Allow overriding of post date in the front matter (#62, #38) diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb index 93d94868..1fa9982c 100644 --- a/lib/jekyll/tags/highlight.rb +++ b/lib/jekyll/tags/highlight.rb @@ -31,10 +31,10 @@ module Jekyll def render_pygments(context, code) output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang) - if context["content_type"] == "markdown" - return "\n" + output + "\n" - elsif context["content_type"] == "textile" - return "" + output + "" + case context["content_type"] + when "markdown" then "\n" + output + "\n" + when "textile" then "" + output + "" + else output end end