From 007b7d45dca3e0860317c0c01670181d78912f31 Mon Sep 17 00:00:00 2001 From: Tom Fejfar Date: Wed, 23 Mar 2016 14:03:50 -0700 Subject: [PATCH] Ensure Rouge closes its div/figure properly after highlighting ends. Fixes #4474 --- test/test_tags.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test_tags.rb b/test/test_tags.rb index dd1db97b..b6402150 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -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 "

This is not yet highlighted

\n\n
1
test\n
\n\n

This should not be highlighted, right?

", @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]"