2 package IkiWiki::Plugin::recentchangesdiff;
11 hook(type => "pagetemplate", id => "recentchangesdiff",
12 call => \&pagetemplate);
15 sub pagetemplate (@) { #{{{
17 my $template=$params{template};
18 if ($config{rcs} && exists $params{rev} && length $params{rev} &&
19 $template->query(name => "diff")) {
20 my @lines=IkiWiki::rcs_diff($params{rev});
23 if (@lines > $maxlines) {
24 # only include so many lines of diff
25 $diff=join("", @lines[0..($maxlines-1)])."\n".
26 gettext("(Diff truncated)");
29 $diff=join("", @lines);
31 # escape links and preprocessor stuff
32 $diff =~ s/(?<!\\)\[\[/\\\[\[/g;
33 $template->param(diff => $diff);