From 89256ab870299242c2f62858680c4a2870600a14 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Sep 2008 18:05:36 -0400 Subject: htmlscrubber: Add a config setting that can be used to disable the scrubber acting on a set of pages. --- IkiWiki/Plugin/htmlscrubber.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'IkiWiki/Plugin/htmlscrubber.pm') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 923907b04..7398c8478 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -41,10 +41,26 @@ sub getsetup () { #{{{ safe => 1, rebuild => undef, }, + htmlscrubber_skip => { + type => "pagespec", + example => "!*/Discussion", + description => "PageSpec specifying pages not to scrub", + link => "ikiwiki/PageSpec", + safe => 1, + rebuild => undef, + }, } #}}} sub sanitize (@) { #{{{ my %params=@_; + + if (exists $config{htmlscrubber_skip} && + length $config{htmlscrubber_skip} && + exists $params{destpage} && + pagespec_match($params{destpage}, $config{htmlscrubber_skip})) { + return $params{content}; + } + return scrubber()->scrub($params{content}); } # }}} -- cgit v1.2.3