Renderer: use Convertible's way of picking the last Converter's output extension
This commit is contained in:
parent
d343da61eb
commit
7d81c00b29
|
@ -25,10 +25,20 @@ module Jekyll
|
|||
@output_ext ||= if document.permalink
|
||||
File.extname(document.permalink)
|
||||
else
|
||||
converters.first.output_ext(document.extname)
|
||||
if output_exts.size == 1
|
||||
output_exts.last
|
||||
else
|
||||
output_exts[-2]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def output_exts
|
||||
@output_exts ||= converters.map do |c|
|
||||
c.output_ext(document.extname)
|
||||
end.compact
|
||||
end
|
||||
|
||||
######################
|
||||
## DAT RENDER THO
|
||||
######################
|
||||
|
|
Loading…
Reference in New Issue