test/devcenter-parser_test.rb in devcenter-parser-1.3.2 vs test/devcenter-parser_test.rb in devcenter-parser-1.3.4

- old
+ new

@@ -191,23 +191,81 @@ html = <<-HTML <p>Testing</p> <div class="callout"> <p><strong>strong</strong></p> +</div> +<p class="devcenter-parser-special-block-separator" style="display:none"> </p> + +<blockquote> <p>normal</p> -</div> +</blockquote> <p>And that’s it.</p> HTML mds.each do |md| assert_github_result(md, html) end end end + it 'github markdown generates separate special blocks from blockquotes separated by empty lines' do + md = <<-MARKDOWN +> warning +> foo + +> note +> bar + MARKDOWN + + html = <<-HTML +<div class="warning"> +<p>foo</p> +</div> + +<p class="devcenter-parser-special-block-separator" style="display:none"> </p> + +<div class="note"> +<p>bar</p> +</div> + HTML + + assert_github_result md, html + end + + it 'github markdown supports tables' do + md = <<-MARKDOWN +| A | B | +| --- | --- | +| 1 | 2 | +| 3 | 4 | + MARKDOWN + + html = <<-HTML +<table> +<thead><tr> +<th>A</th> +<th>B</th> +</tr></thead> +<tbody> +<tr> +<td>1</td> +<td>2</td> +</tr> +<tr> +<td>3</td> +<td>4</td> +</tr> +</tbody> +</table> + HTML + + assert_github_result md, html + end + it "does emdashes both in all flavours" do md = "foo -- bar" html = '<p>foo – bar</p>' assert_all_flavours_result(md, html) end @@ -232,9 +290,44 @@ it 'does not add href attribute to links where it does not exist' do md = '<a name="heh"></a>' assert_maruku_result md, md assert_github_result md, "<p>#{md}</p>" + end + + + it 'generates separate blockquotes from blockquotes separated by empty lines' do + md = <<-MARKDOWN +> foo + +> bar + MARKDOWN + + html_maruku = <<-HTML +<blockquote> +<p>foo</p> +</blockquote> +<p class="devcenter-parser-special-block-separator" style="display:none"> </p> +<blockquote> +<p>bar</p> +</blockquote> + HTML + + assert_maruku_result md, html_maruku + + html_github = <<-HTML +<blockquote> +<p>foo</p> +</blockquote> + +<p class="devcenter-parser-special-block-separator" style="display:none"> </p> + +<blockquote> +<p>bar</p> +</blockquote> + HTML + + assert_github_result md, html_github end end \ No newline at end of file