diff options
Diffstat (limited to 'IkiWiki/Plugin/htmlscrubber.pm')
-rw-r--r-- | IkiWiki/Plugin/htmlscrubber.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 3bdaccea1..923907b04 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -10,6 +10,7 @@ use IkiWiki 2.00; our $safe_url_regexp; sub import { #{{{ + hook(type => "getsetup", id => "htmlscrubber", call => \&getsetup); hook(type => "sanitize", id => "htmlscrubber", call => \&sanitize); # Only known uri schemes are allowed to avoid all the ways of @@ -34,6 +35,14 @@ sub import { #{{{ $safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/|[^:]+(?:$|\/))/i; } # }}} +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => undef, + }, +} #}}} + sub sanitize (@) { #{{{ my %params=@_; return scrubber()->scrub($params{content}); |