summaryrefslogtreecommitdiff
path: root/t/htmlize.t
blob: a9ccfedcbb184b9a31165b63d9009f012416cbf5 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use Test::More tests => 4;
  5. use Encode;
  6. BEGIN { use_ok("IkiWiki"); }
  7. # Initialize htmlscrubber plugin
  8. %config=IkiWiki::defaultconfig();
  9. $config{srcdir}=$config{destdir}="/dev/null";
  10. IkiWiki::loadplugins();
  11. IkiWiki::checkconfig();
  12. is(IkiWiki::htmlize("foo", "mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
  13. "basic");
  14. is(IkiWiki::htmlize("foo", "mdwn", 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("foo", "mdwn", readfile("t/test2.mdwn")),
  18. "this file crashes markdown if it's fed in as decoded utf-8");