diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-06-04 01:24:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-06-04 01:24:23 -0400 |
commit | 1dddec0ba9f66f082f4b8349916cdb6bdb5636e3 (patch) | |
tree | 2ee6818cd5f9c896ab0de2caea677ba5a9cc18f9 /t | |
parent | 1546b48b979399eb33ce502a00b089263d7cee26 (diff) | |
download | ikiwiki-1dddec0ba9f66f082f4b8349916cdb6bdb5636e3.tar ikiwiki-1dddec0ba9f66f082f4b8349916cdb6bdb5636e3.tar.gz |
Pass a destpage parameter to the sanitize hook.
Because the search plugin needed it, also because it's one of the few
plugins that didn't already have it.
I also considered adding it to htmlize, but I really cannot imagine caring
what the destpage is when htmlizing. (I'll probably be poven wrong later.)
Diffstat (limited to 't')
-rwxr-xr-x | t/crazy-badass-perl-bug.t | 4 | ||||
-rwxr-xr-x | t/htmlize.t | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/t/crazy-badass-perl-bug.t b/t/crazy-badass-perl-bug.t index 27812559b..80724d174 100755 --- a/t/crazy-badass-perl-bug.t +++ b/t/crazy-badass-perl-bug.t @@ -13,6 +13,6 @@ BEGIN { use_ok("IkiWiki"); } %config=IkiWiki::defaultconfig(); $config{srcdir}=$config{destdir}="/dev/null"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); -ok(IkiWiki::htmlize("foo", "mdwn", readfile("t/test1.mdwn"))); -ok(IkiWiki::htmlize("foo", "mdwn", readfile("t/test3.mdwn")), +ok(IkiWiki::htmlize("foo", "foo", "mdwn", readfile("t/test1.mdwn"))); +ok(IkiWiki::htmlize("foo", "foo", "mdwn", readfile("t/test3.mdwn")), "wtf?") for 1..100; diff --git a/t/htmlize.t b/t/htmlize.t index b19dbcf68..a7e7f8c39 100755 --- a/t/htmlize.t +++ b/t/htmlize.t @@ -12,16 +12,16 @@ $config{srcdir}=$config{destdir}="/dev/null"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); -is(IkiWiki::htmlize("foo", "mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n", +is(IkiWiki::htmlize("foo", "foo", "mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n", "basic"); -is(IkiWiki::htmlize("foo", "mdwn", readfile("t/test1.mdwn")), +is(IkiWiki::htmlize("foo", "foo", "mdwn", readfile("t/test1.mdwn")), Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="ó" />\nóóóóó</p>\n}), "utf8; bug #373203"); -ok(IkiWiki::htmlize("foo", "mdwn", readfile("t/test2.mdwn")), +ok(IkiWiki::htmlize("foo", "foo", "mdwn", readfile("t/test2.mdwn")), "this file crashes markdown if it's fed in as decoded utf-8"); sub gotcha { - my $html=IkiWiki::htmlize("foo", "mdwn", shift); + my $html=IkiWiki::htmlize("foo", "foo", "mdwn", shift); return $html =~ /GOTCHA/; } ok(!gotcha(q{<a href="javascript:alert('GOTCHA')">click me</a>}), @@ -56,15 +56,15 @@ ok(gotcha(q{<p>javascript:alert('GOTCHA')</p>}), be perverse and assume it is?)"); ok(gotcha(q{<img src="javascript.png?GOTCHA">}), "not javascript"); ok(gotcha(q{<a href="javascript.png?GOTCHA">foo</a>}), "not javascript"); -is(IkiWiki::htmlize("foo", "mdwn", +is(IkiWiki::htmlize("foo", "foo", "mdwn", q{<img alt="foo" src="foo.gif">}), q{<img alt="foo" src="foo.gif">}, "img with alt tag allowed"); -is(IkiWiki::htmlize("foo", "mdwn", +is(IkiWiki::htmlize("foo", "foo", "mdwn", q{<a href="http://google.com/">}), q{<a href="http://google.com/">}, "absolute url allowed"); -is(IkiWiki::htmlize("foo", "mdwn", +is(IkiWiki::htmlize("foo", "foo", "mdwn", q{<a href="foo.html">}), q{<a href="foo.html">}, "relative url allowed"); -is(IkiWiki::htmlize("foo", "mdwn", +is(IkiWiki::htmlize("foo", "foo", "mdwn", q{<span class="foo">bar</span>}), q{<span class="foo">bar</span>}, "class attribute allowed"); |