2006-06-15 08:37:33 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2006-06-16 06:56:25 +02:00
|
|
|
use Test::More tests => 5;
|
2006-06-15 08:37:33 +02:00
|
|
|
use Encode;
|
|
|
|
|
|
|
|
BEGIN { use_ok("IkiWiki"); }
|
|
|
|
BEGIN { use_ok("IkiWiki::Render"); }
|
|
|
|
|
|
|
|
# Initialize htmlscrubber plugin
|
|
|
|
%IkiWiki::config=IkiWiki::defaultconfig();
|
|
|
|
$IkiWiki::config{srcdir}=$IkiWiki::config{destdir}="/dev/null";
|
|
|
|
IkiWiki::checkconfig();
|
|
|
|
|
2006-07-04 00:08:04 +02:00
|
|
|
is(IkiWiki::htmlize("mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
|
2006-06-15 08:37:33 +02:00
|
|
|
"basic");
|
2006-07-04 00:08:04 +02:00
|
|
|
is(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test1.mdwn")),
|
2006-06-15 08:37:33 +02:00
|
|
|
Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="ó" />\nóóóóó</p>\n}),
|
|
|
|
"utf8; bug #373203");
|
2006-07-04 00:08:04 +02:00
|
|
|
ok(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test2.mdwn")),
|
2006-06-16 06:56:25 +02:00
|
|
|
"this file crashes markdown if it's fed in as decoded utf-8");
|