spec/test_spec.rb in jekyll-commonmark-ghpages-0.1.1 vs spec/test_spec.rb in jekyll-commonmark-ghpages-0.1.2

- old
+ new

@@ -27,5 +27,29 @@ } subject { converter.convert("### \"Hi\" <xmp>[^nb]\n\n[^nb]: Yes.\n") } it { is_expected.to match %r{<h3 id="[^"]*">“Hi” &lt;xmp><sup[^>]*><a href="#fn1"[^>]*>\[1\]</a></sup></h3>\n<section class="footnotes">\n<ol>\n<li id="fn1">\n<p>Yes. <a href="#fnref1".*</a></p>} } end + +describe Jekyll::Renderer do + it "should not re-process markdown in a liquid tag" do + site = Jekyll::Site.new(Jekyll.configuration("markdown" => "CommonMarkGhPages")) + collection = Jekyll::Collection.new(site, "pages") + document = Jekyll::Document.new("hello.md", site: site, collection: collection) + document.content = "**Hi**\n" \ + "\n" \ + "```markdown\n" \ + "**Yo**\n" \ + "```\n" \ + "\n" \ + "{% highlight markdown %}\n" \ + "**Hey**\n" \ + "\n" \ + "**Hello**\n" \ + "{% endhighlight %}\n" + out = Jekyll::Renderer.new(site, document).run + expect(out).to match %r(<p><strong>Hi</strong></p>) + expect(out).to match %r(<span class="gs">\*\*Yo\*\*</span>) + expect(out).to match %r(<span class="gs">\*\*Hey\*\*</span>) + expect(out).to match %r(<span class="gs">\*\*Hello\*\*</span>) + end +end