aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/htmlscrubber.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-26 18:05:36 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-26 18:07:37 -0400
commit89256ab870299242c2f62858680c4a2870600a14 (patch)
tree803b961e94d0bfa93ede5eecd61b485ce9ab0593 /IkiWiki/Plugin/htmlscrubber.pm
parent83429adf04b7a4e2f2a01de9c276d3160173fb8b (diff)
downloadikiwiki-89256ab870299242c2f62858680c4a2870600a14.tar
ikiwiki-89256ab870299242c2f62858680c4a2870600a14.tar.gz
htmlscrubber: Add a config setting that can be used to disable the scrubber acting on a set of pages.
Diffstat (limited to 'IkiWiki/Plugin/htmlscrubber.pm')
-rw-r--r--IkiWiki/Plugin/htmlscrubber.pm16
1 files changed, 16 insertions, 0 deletions
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});
} # }}}