]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/htmlscrubber.pm
updated from pesco's darcs repo, current to Oct 11 version
[git.ikiwiki.info.git] / IkiWiki / Plugin / htmlscrubber.pm
index 923907b047b8657e03857c91a500df5eb18911c5..7398c84784632048c41eab1976436578a8bf7027 100644 (file)
@@ -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});
 } # }}}