]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/mdwn.t
Need <sys/wait.h> for waitpid (NetBSD 8 warns).
[git.ikiwiki.info.git] / t / mdwn.t
index 93b8bd8e9971a937aacedd2951219ca63c27abbf..ca3180139445f7659735e998f9c265b074db4da2 100755 (executable)
--- a/t/mdwn.t
+++ b/t/mdwn.t
@@ -8,6 +8,7 @@ BEGIN { use_ok("IkiWiki"); }
 
 %config=IkiWiki::defaultconfig();
 $config{srcdir}=$config{destdir}="/dev/null";
 
 %config=IkiWiki::defaultconfig();
 $config{srcdir}=$config{destdir}="/dev/null";
+$config{disable_plugins}=["htmlscrubber"];
 IkiWiki::loadplugins();
 IkiWiki::checkconfig();
 
 IkiWiki::loadplugins();
 IkiWiki::checkconfig();
 
@@ -41,4 +42,25 @@ like(IkiWiki::htmlize("foo", "foo", "mdwn",
        "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"),
        qr{<p>This works<sup\W}, "footnotes can be enabled");
 
        "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"),
        qr{<p>This works<sup\W}, "footnotes can be enabled");
 
+SKIP: {
+       skip 'set $IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT if you have Discount 2.2.0+', 4
+               unless $ENV{IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT};
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "Definition list\n: A useful HTML structure\n"),
+               qr{<dl>.*<dt>Definition list</dt>\s*<dd>A useful HTML structure</dd>}s,
+               "definition lists are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "```\n#!/bin/sh\n```\n"),
+               qr{<pre>\s*<code>\s*[#]!/bin/sh\s*</code>\s*</pre>}s,
+               "code blocks are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "<foo_bar>"),
+               qr{<foo_bar>},
+               "GitHub tag name extensions are enabled by default");
+       like(IkiWiki::htmlize("foo", "foo", "mdwn",
+                       "<style>foo</style>"),
+               qr{<style>foo</style>},
+               "Styles are not stripped by default");
+}
+
 done_testing();
 done_testing();