X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/6652de5e1abcaac3ee2f4bf17e5a4b847fcadb0d..71d2d930272bcdba0b5d2671506e2386ea416632:/IkiWiki/Plugin/htmlscrubber.pm diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 41cf6c991..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{ @@ -43,7 +44,8 @@ sub scrubber { #{{{ selected shape size span src start summary tabindex target title type usemap valign value vspace width - }}], + }, "/" => 1, # emit proper
XHTML + }], ); return $_scrubber; } # }}}