X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6652de5e1abcaac3ee2f4bf17e5a4b847fcadb0d..a9fb41084613bbc4c53faeb33ee90a6eb6c52533:/IkiWiki/Plugin/htmlscrubber.pm?ds=inline 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; } # }}}