diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb index 721bea64..284318cb 100644 --- a/lib/jekyll/converters/markdown.rb +++ b/lib/jekyll/converters/markdown.rb @@ -22,6 +22,8 @@ module Jekyll raise Errors::FatalException, "Bailing out; invalid Markdown processor." end + @cache = Jekyll::Cache.new("Jekyll::Converters::Markdown") + @setup = true end @@ -89,7 +91,9 @@ module Jekyll # Returns a String of the converted content. def convert(content) setup - @parser.convert(content) + @cache.getset(content) do + @parser.convert(content) + end end private diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index 94d6a4df..b55180b6 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -32,6 +32,7 @@ class TestKramdown < JekyllUnitTest @config = Jekyll.configuration(@config) @markdown = Converters::Markdown.new(@config) @markdown.setup + Jekyll::Cache.clear end should "fill symbolized keys into config for compatibility with kramdown" do @@ -94,7 +95,7 @@ class TestKramdown < JekyllUnitTest MARKDOWN div_highlight = ">div.highlight" selector = "div.highlighter-rouge#{div_highlight}>pre.highlight>code" - refute result.css(selector).empty? + refute(result.css(selector).empty?, result.to_html) end context "when a custom highlighter is chosen" do