1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
use strict;
use warnings;
use Test::More tests => 4;
use_ok( 'Text::Markdown' );
my $m = Text::Markdown->new( tab_width => 2 );
my $instr = q{start
<h1>HTML block</h1>
end
};
my $expstr = q{<p>start</p>
<pre><code><h1>HTML block</h1>
</code></pre>
<p>end</p>
};
is($m->markdown($instr) => $expstr, 'Correct (constructor)');
is(Text::Markdown->new->markdown($instr, { tab_width => 2}) => $expstr, 'Correct (markdown method option)');
my $txt = $m->markdown(<<'END_MARKDOWN');
This is a para.
This is code.
---
This is code.
This is a para.
END_MARKDOWN
unlike($txt, qr{<hr}, "no HR elements when the hr is in a code block");
|