diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-09-26 18:05:36 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-09-26 18:07:37 -0400 |
commit | 89256ab870299242c2f62858680c4a2870600a14 (patch) | |
tree | 803b961e94d0bfa93ede5eecd61b485ce9ab0593 /IkiWiki | |
parent | 83429adf04b7a4e2f2a01de9c276d3160173fb8b (diff) |
htmlscrubber: Add a config setting that can be used to disable the scrubber acting on a set of pages.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/htmlscrubber.pm | 16 |
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}); } # }}} |