summaryrefslogtreecommitdiff
path: root/t/htmlize.t
blob: 742b6e2bcaa6336f829c00409e1d2b7f89cbd395 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use Test::More tests => 5;
  5. use Encode;
  6. BEGIN { use_ok("IkiWiki"); }
  7. BEGIN { use_ok("IkiWiki::Render"); }
  8. # Initialize htmlscrubber plugin
  9. %IkiWiki::config=IkiWiki::defaultconfig();
  10. $IkiWiki::config{srcdir}=$IkiWiki::config{destdir}="/dev/null";
  11. IkiWiki::checkconfig();
  12. is(IkiWiki::htmlize(".mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
  13. "basic");
  14. is(IkiWiki::htmlize(".mdwn", IkiWiki::readfile("t/test1.mdwn")),
  15. Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="&oacute;" />\nóóóóó</p>\n}),
  16. "utf8; bug #373203");
  17. ok(IkiWiki::htmlize(".mdwn", IkiWiki::readfile("t/test2.mdwn")),
  18. "this file crashes markdown if it's fed in as decoded utf-8");