Repository URL to install this package:
Version:
3.3.4 ▾
|
require 'test_helper'
class HTML5Test < Redcarpet::TestCase
def test_that_html5_works
section = <<EOS
<section>
<p>The quick brown fox jumps over the lazy dog.</p>
</section>
EOS
figure = <<EOS
<figure>
<img src="http://example.org/image.jpg" alt="">
<figcaption>
<p>Hello world!</p>
</figcaption>
</figure>
EOS
assert_renders section, section
assert_renders figure, figure
end
def test_that_html5_works_with_code_blocks
section = <<EOS
\t<section>
\t\t<p>The quick brown fox jumps over the lazy dog.</p>
\t</section>
EOS
section_expected = <<EOE
<pre><code><section>
<p>The quick brown fox jumps over the lazy dog.</p>
</section>
</code></pre>
EOE
header = <<EOS
<header>
<hgroup>
<h1>Section heading</h1>
<h2>Subhead</h2>
</hgroup>
</header>
EOS
header_expected = <<EOE
<pre><code><header>
<hgroup>
<h1>Section heading</h1>
<h2>Subhead</h2>
</hgroup>
</header>
</code></pre>
EOE
assert_renders section_expected, section
assert_renders header_expected, header
end
def test_script_tag_recognition
markdown = <<-Md
<script type="text/javascript">
alert('Foo!');
</script>
Md
assert_renders markdown, markdown
end
end