summaryrefslogtreecommitdiff
path: root/t/htmlize.t
blob: 070fbf9584740a1f5b65e37c40e0a79c9bb5ad69 (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::loadplugins();
  12. IkiWiki::checkconfig();
  13. is(IkiWiki::htmlize("mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
  14. "basic");
  15. is(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test1.mdwn")),
  16. Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="&oacute;" />\nóóóóó</p>\n}),
  17. "utf8; bug #373203");
  18. ok(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test2.mdwn")),
  19. "this file crashes markdown if it's fed in as decoded utf-8");