summaryrefslogtreecommitdiff
path: root/t/htmlize.t
blob: 687eb03a8b104a67b848e12c9ccc57beb81e9643 (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");