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
|
use strict;
use warnings;
use Test::More tests => 4;
use_ok( 'Text::MultiMarkdown');
my $instr = q{A trivial block of text with a WikiWord};
my $m = Text::MultiMarkdown->new(
use_wikilinks => 1,
);
my $outstr = qq{<p>A trivial block of text with a <a href="WikiWord">WikiWord</a></p>\n};
is(
$m->markdown($instr) => $outstr,
'Markdown with wiki links, no base url'
);
$m = Text::MultiMarkdown->new(
use_wikilinks => 1,
base_url => 'http://www.test.com/',
);
$outstr = qq{<p>A trivial block of text with a <a href="http://www.test.com/WikiWord">WikiWord</a></p>\n};
is(
$m->markdown($instr) => $outstr,
'Markdown with wiki links, with base url in instance'
);
$m = Text::MultiMarkdown->new(
use_wikilinks => 1,
use_metadata => 1,
);
$instr = qq{base url: http://www.test.com/\n\n} . $instr;
$outstr = qq{base url: http://www.test.com/<br />\n\n} . $outstr;
is(
$m->markdown($instr) => $outstr,
'Markdown with wiki links, with base url in metadata'
);
|