Cache converter in renderer (#7183)

Merge pull request 7183
This commit is contained in:
Pat Hawks 2018-10-02 03:16:49 -05:00 committed by jekyllbot
parent 0b90e536ab
commit b8dfc9a32f
1 changed files with 11 additions and 9 deletions

View File

@ -96,15 +96,17 @@ module Jekyll
# #
# Returns String the converted content. # Returns String the converted content.
def convert(content) def convert(content)
converters.reduce(content) do |output, converter| Jekyll::Cache.new("Jekyll::Renderer").getset(content) do
begin converters.reduce(content) do |output, converter|
converter.convert output begin
rescue StandardError => e converter.convert output
Jekyll.logger.error "Conversion error:", rescue StandardError => e
"#{converter.class} encountered an error while "\ Jekyll.logger.error "Conversion error:",
"converting '#{document.relative_path}':" "#{converter.class} encountered an error while "\
Jekyll.logger.error("", e.to_s) "converting '#{document.relative_path}':"
raise e Jekyll.logger.error("", e.to_s)
raise e
end
end end
end end
end end