Ensure Rouge closes its div/figure properly after highlighting ends.
Fixes #4474
This commit is contained in:
parent
b5e459430b
commit
007b7d45dc
|
@ -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]"
|
||||
|
|
Loading…
Reference in New Issue