Ensure Rouge closes its div/figure properly after highlighting ends.

Fixes #4474
This commit is contained in:
Tom Fejfar 2016-03-23 14:03:50 -07:00 committed by Parker Moore
parent b5e459430b
commit 007b7d45dc
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 21 additions and 0 deletions

View File

@ -317,6 +317,27 @@ EOS
end
end
context "post content has highlight tag with linenumbers" do
setup do
create_post <<-EOS
---
title: This is a test
---
This is not yet highlighted
{% highlight php linenos %}
test
{% endhighlight %}
This should not be highlighted, right?
EOS
end
should "should stop highlighting at boundary" do
assert_match "<p>This is not yet highlighted</p>\n\n<figure class=\"highlight\"><pre><code class=\"language-php\" data-lang=\"php\"><table style=\"border-spacing: 0\"><tbody><tr><td class=\"gutter gl\" style=\"text-align: right\"><pre class=\"lineno\">1</pre></td><td class=\"code\"><pre>test<span class=\"w\">\n</span></pre></td></tr></tbody></table></code></pre></figure>\n\n<p>This should not be highlighted, right?</p>", @result
end
end
context "post content has highlight tag with preceding spaces & Windows-style newlines" do
setup do
fill_post "\r\n\r\n\r\n [,1] [,2]"