my $page=shift;
$content =~ s{(\\?)$config{wiki_link_regexp}}{
- $1 ? "[[$2]]" : htmllink($page, $2)
+ $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2)))
+ : ( $1 ? "[[$3]]" : htmllink($page, titlepage($3)))
}eg;
return $content;
$ret.=$template->output;
}
- return $ret;
+ return "</p>$ret<p>";
} #}}}
sub genpage ($$$) { #{{{
filename => "$config{templatedir}/page.tmpl");
if (length $config{cgiurl}) {
- $template->param(editurl => "$config{cgiurl}?do=edit&page=$page");
- $template->param(prefsurl => "$config{cgiurl}?do=prefs");
+ $template->param(editurl => cgiurl(do => "edit", page => $page));
+ $template->param(prefsurl => cgiurl(do => "prefs"));
if ($config{rcs}) {
- $template->param(recentchangesurl => "$config{cgiurl}?do=recentchanges");
+ $template->param(recentchangesurl => cgiurl(do => "recentchanges"));
}
}
}
if ($config{rss} && $inlinepages{$page}) {
- $template->param(rssurl => rsspage($page));
+ $template->param(rssurl => rsspage(basename($page)));
}
$template->param(
my $parentpage=shift;
my %params=@_;
- return "" if exists $params{archive} && $params{archive} eq 'yes';
-
if (! exists $params{show}) {
$params{show}=10;
}
my @links;
while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
- push @links, lc($1);
+ push @links, titlepage($2);
}
# Discussion links are a special case since they're not in the text
# of the page, but on its template.