test/markdown_test.rb in rdiscount-1.3.5 vs test/markdown_test.rb in rdiscount-1.5.5
- old
+ new
@@ -92,9 +92,26 @@
markdown = Markdown.new("Para 1\n\n<div><pre>HTML block\n</pre></div>\n\nPara 2 [Link](#anchor)")
assert_equal "<p>Para 1</p>\n\n<div><pre>HTML block\n</pre></div>\n\n\n<p>Para 2 <a href=\"#anchor\">Link</a></p>\n",
markdown.to_html
end
+ def test_filter_html_doesnt_break_two_space_hard_break
+ markdown = Markdown.new("Lorem, \nipsum\n", :filter_html)
+ assert_equal "<p>Lorem,<br/>\nipsum</p>\n",
+ markdown.to_html
+ end
+
+ # This isn't in the spec but is Markdown.pl behavior.
+ def test_block_quotes_preceded_by_spaces
+ markdown = Markdown.new(
+ "A wise man once said:\n\n" +
+ " > Isn't it wonderful just to be alive.\n"
+ )
+ assert_equal "<p>A wise man once said:</p>\n\n" +
+ "<blockquote><p>Isn't it wonderful just to be alive.</p></blockquote>\n",
+ markdown.to_html
+ end
+
# Build tests for each file in the MarkdownTest test suite
Dir["#{MARKDOWN_TEST_DIR}/Tests/*.text"].each do |text_file|
basename = File.basename(text_file).sub(/\.text$/, '')