refactored render_pygments to remove duplicate code
This commit is contained in:
parent
4cc0873172
commit
e3bd1c88e9
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue