#!/usr/bin/perl use warnings; use strict; use Test::More; use Encode; BEGIN { use_ok("IkiWiki"); } %config=IkiWiki::defaultconfig(); $config{srcdir}=$config{destdir}="/dev/null"; $config{disable_plugins}=["htmlscrubber"]; IkiWiki::loadplugins(); IkiWiki::checkconfig(); is(IkiWiki::htmlize("foo", "foo", "mdwn", "C. S. Lewis wrote books\n"), "

C. S. Lewis wrote books

\n", "alphalist off by default"); $config{mdwn_alpha_lists} = 1; like(IkiWiki::htmlize("foo", "foo", "mdwn", "A. One\n". "B. Two\n"), qr{A. One\sB. Two

\n}, "alphalist can be disabled"); like(IkiWiki::htmlize("foo", "foo", "mdwn", "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"), qr{

This works\^1}, "footnotes can be disabled"); $config{mdwn_footnotes} = 1; like(IkiWiki::htmlize("foo", "foo", "mdwn", "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"), qr{

This works.*

Definition list
\s*
A useful HTML structure
}s, "definition lists are enabled by default"); like(IkiWiki::htmlize("foo", "foo", "mdwn", "```\n#!/bin/sh\n```\n"), qr{
\s*\s*[#]!/bin/sh\s*\s*
}s, "code blocks are enabled by default"); like(IkiWiki::htmlize("foo", "foo", "mdwn", ""), qr{}, "GitHub tag name extensions are enabled by default"); like(IkiWiki::htmlize("foo", "foo", "mdwn", ""), qr{}, "Styles are not stripped by default"); } done_testing();