]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/htmlscrubber.pm
* Add the needsbuild hook. Plugins can use this to manipulate which files
[git.ikiwiki.info.git] / IkiWiki / Plugin / htmlscrubber.pm
index 8e83918170b3b8f4d11a0fed369675338eedcaca..c5b08f60435b8b37ffb0b75732cfe92a8a6980ad 100644 (file)
@@ -3,15 +3,15 @@ package IkiWiki::Plugin::htmlscrubber;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 
 sub import { #{{{
 
 sub import { #{{{
-       IkiWiki::hook(type => "sanitize", id => "htmlscrubber",
-               call => \&sanitize);
+       hook(type => "sanitize", id => "htmlscrubber", call => \&sanitize);
 } # }}}
 
 } # }}}
 
-sub sanitize ($) { #{{{
-       return scrubber()->scrub(shift);
+sub sanitize (@) { #{{{
+       my %params=@_;
+       return scrubber()->scrub($params{content});
 } # }}}
 
 my $_scrubber;
 } # }}}
 
 my $_scrubber;
@@ -19,6 +19,7 @@ sub scrubber { #{{{
        return $_scrubber if defined $_scrubber;
        
        eval q{use HTML::Scrubber};
        return $_scrubber if defined $_scrubber;
        
        eval q{use HTML::Scrubber};
+       error($@) if $@;
        # Lists based on http://feedparser.org/docs/html-sanitization.html
        $_scrubber = HTML::Scrubber->new(
                allow => [qw{
        # Lists based on http://feedparser.org/docs/html-sanitization.html
        $_scrubber = HTML::Scrubber->new(
                allow => [qw{