render_partial always converts the content

Signed-off-by: Brandon Mathis <brandon@imathis.com>
This commit is contained in:
Robert Wijas 2011-10-02 09:41:11 +02:00 committed by Brandon Mathis
parent 82f8142cc4
commit 1ac51f0950
1 changed files with 9 additions and 10 deletions

View File

@ -31,11 +31,9 @@ module Jekyll
def initialize(tag_name, markup, tokens)
@file = nil
@raw = false
@convert = false
if markup =~ /^(\S+)\s?(\w+)?/
@file = $1.strip
@raw = $2 == 'raw'
@convert = $2 == 'convert'
end
super
end
@ -61,15 +59,16 @@ module Jekyll
partial = Liquid::Template.parse(contents)
context.stack do
contents = partial.render(context)
if @convert
site = context.registers[:site]
ext = File.extname(@file)
converter = site.converters.find { |c| c.matches(ext) }
contents = converter.convert(contents) unless converter.nil?
end
contents
site = context.registers[:site]
ext = File.extname(@file)
converter = site.converters.find { |c| c.matches(ext) }
if converter.nil?
contents
else
converter.convert(contents)
end
end
end
end