refactored render_pygments to remove duplicate code

This commit is contained in:
Patrick Crowley 2009-10-23 08:03:25 -07:00
parent 4cc0873172
commit e3bd1c88e9
1 changed files with 3 additions and 4 deletions

View File

@ -30,12 +30,11 @@ module Jekyll
end end
def render_pygments(context, code) def render_pygments(context, code)
output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
if context["content_type"] == "markdown" if context["content_type"] == "markdown"
return "\n" + add_code_tags(Albino.new(code, @lang).to_s(@options), @lang) + "\n" return "\n" + output + "\n"
elsif context["content_type"] == "textile" elsif context["content_type"] == "textile"
return "<notextile>" + add_code_tags(Albino.new(code, @lang).to_s(@options), @lang) + "</notextile>" return "<notextile>" + output + "</notextile>"
else
return add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
end end
end end