Skip to content

Commit

Permalink
spec exposes trailing <li> bug.
Browse files Browse the repository at this point in the history
Happens when there are more than 3 trailing 
newlines following a ul.
  • Loading branch information
knowuh committed Jan 13, 2011
1 parent ef56166 commit 5465bf8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/parser_spec.rb
Expand Up @@ -75,6 +75,13 @@
html = "<p>This is a paragraph</p>\n<p>This is a<br />\nline break.</p>\n<div>\n<p>test</p>\n</div>"
RedCloth.new(input).to_html.should == html
end

it "should not add spurious li tags to the end of markup" do
input = "* one\n* two\n*thee \n\n"
failing_input = "* one\n* two\n*thee \n\n\n"
RedCloth.new(input).to_html.should_not match /<li>$/
RedCloth.new(failing_input).to_html.should_not match /<li>$/
end

if RUBY_VERSION > "1.9.0"
it "should preserve character encoding" do
Expand Down

0 comments on commit 5465bf8

Please sign in to comment.