aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-29 12:37:39 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-29 12:37:39 -0500
commit598d338b11cbcbf5d87517f3b8fcd99e357a31a2 (patch)
tree59850d616fd43e41895c5a7564e8d012fc6badc4
parent7a4b7b1964f35527571aee78fb7048284e5d5061 (diff)
downloadikiwiki-598d338b11cbcbf5d87517f3b8fcd99e357a31a2.tar
ikiwiki-598d338b11cbcbf5d87517f3b8fcd99e357a31a2.tar.gz
escape wikilinks and preprocessor directives
-rw-r--r--IkiWiki/Plugin/recentchanges.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index 5727f9af1..6c9848ba3 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -6,8 +6,6 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
- hook(type => "checkconfig", id => "recentchanges",
- call => \&checkconfig);
hook(type => "needsbuild", id => "recentchanges",
call => \&needsbuild);
hook(type => "preprocess", id => "recentchanges",
@@ -16,15 +14,11 @@ sub import { #{{{
call => \&htmlize);
} #}}}
-sub checkconfig () { #{{{
+sub needsbuild () { #{{{
my @changes=IkiWiki::rcs_recentchanges(100);
updatechanges("*", "recentchanges", \@changes);
} #}}}
-sub needsbuild () { #{{{
- # TODO
-} #}}}
-
sub preprocess (@) { #{{{
my %params=@_;
@@ -96,7 +90,10 @@ sub store ($$) { #{{{
shift->(page => $page, destpage => $page, template => $template);
});
- writefile($page."._change", $config{srcdir}, $template->output);
+ my $html=$template->output;
+ # escape wikilinks and preprocessor stuff
+ $html=~s/(?<!\\)\[\[/\\\[\[/g;
+ writefile($page."._change", $config{srcdir}, $html);
utime $change->{when}, $change->{when}, "$config{srcdir}/$page._change";
} #}}}