2 package IkiWiki::Plugin::recentchangesdiff;
12 hook(type => "getsetup", id => "recentchangesdiff",
14 hook(type => "pagetemplate", id => "recentchangesdiff",
15 call => \&pagetemplate);
26 sub pagetemplate (@) {
28 my $template=$params{template};
29 if ($config{rcs} && exists $params{rev} && length $params{rev} &&
30 $template->query(name => "diff")) {
31 my @lines=IkiWiki::rcs_diff($params{rev}, $maxlines+1);
35 if (@lines > $maxlines) {
36 $diff=join("", @lines[0..($maxlines-1)]);
40 $diff=join("", @lines);
42 if (length $diff > 102400) {
43 $diff=substr($diff, 0, 10240);
47 $diff.="\n".gettext("(Diff truncated)");
50 $diff = encode_entities($diff);
51 # escape links and preprocessor stuff
52 $diff = encode_entities($diff, '\[\]');
53 $template->param(diff => $diff);