X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7f64dd4f6688149306282f1a2a951535b9493300..89484c06d97cc7d47118ba9bcf6039431d3ff368:/IkiWiki/Plugin/htmlscrubber.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 8e8391817..ae3ec4456 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -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{