use strict;
use IkiWiki 2.00;
use Encode;
+use HTML::Entities;
sub import { #{{{
hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
do => "recentchanges_link",
page => $_->{page}
).
- "\">".
+ "\" rel=\"nofollow\">".
pagetitle($_->{page}).
"</a>"
}
);
}
- # escape wikilinks and preprocessor stuff in commit messages
if (ref $change->{message}) {
foreach my $field (@{$change->{message}}) {
if (exists $field->{line}) {
- $field->{line} =~ s/(?<!\\)\[\[/\\\[\[/g;
+ # escape html
+ $field->{line} = encode_entities($field->{line});
+ # escape links and preprocessor stuff
+ $field->{line} = encode_entities($field->{line}, '\[\]');
}
}
}
$template->param(
%$change,
commitdate => displaytime($change->{when}, "%X %x"),
- commitdate_raw => scalar localtime($change->{when}),
wikiname => $config{wikiname},
);
- $template->param(permalink => $config{url}."$config{recentchangespage}/#change-".titlepage($change->{rev}))
+ $template->param(permalink => "$config{url}/$config{recentchangespage}/#change-".titlepage($change->{rev}))
if exists $config{url};
IkiWiki::run_hooks(pagetemplate => sub {