]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/htmlscrubber.pm
* Fix the template, toggle, and conditional plugins to filter text before
[git.ikiwiki.info.git] / IkiWiki / Plugin / htmlscrubber.pm
index 8e83918170b3b8f4d11a0fed369675338eedcaca..ae3ec44569d3e666ca5abe60f9afc19e5b6643c6 100644 (file)
@@ -6,12 +6,12 @@ use strict;
 use IkiWiki;
 
 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;
@@ -19,6 +19,7 @@ sub 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{