X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7f64dd4f6688149306282f1a2a951535b9493300..bf1b6228597ce8ff553c468771a1b88804e9332a:/IkiWiki/Plugin/htmlscrubber.pm diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 8e8391817..c5b08f604 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -3,15 +3,15 @@ package IkiWiki::Plugin::htmlscrubber; use warnings; use strict; -use IkiWiki; +use IkiWiki 2.00; 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{