sub titlepage ($) { #{{{
my $title=shift;
$title=~y/ /_/;
- $title=~s/([^-A-Za-z0-9_:+\/])/"__".ord($1)."__"/eg;
+ $title=~s/([^-A-Za-z0-9_:+\/.])/"__".ord($1)."__"/eg;
return $title;
} #}}}
+sub cgiurl (@) { #{{{
+ my %params=@_;
+
+ return $config{cgiurl}."?".join("&", map "$_=$params{$_}", keys %params);
+} #}}}
+
+sub styleurl (;$) { #{{{
+ my $page=shift;
+
+ return "$config{url}/style.css" if ! defined $page;
+
+ $page=~s/[^\/]+$//;
+ $page=~s/[^\/]+\//..\//g;
+ return $page."style.css";
+} #}}}
+
sub htmllink ($$;$$$) { #{{{
my $page=shift;
my $link=shift;
$bestlink=htmlpage($bestlink);
}
if (! grep { $_ eq $bestlink } values %renderedfiles) {
- return "<span><a href=\"$config{cgiurl}?do=create&page=$link&from=$page\">?</a>$linktext</span>"
+ return "<span><a href=\"".
+ cgiurl(do => "create", page => $link, from =>$page).
+ "\">?</a>$linktext</span>"
}
$bestlink=File::Spec->abs2rel($bestlink, dirname($page));
if (! $noimageinline && isinlinableimage($bestlink)) {
- return "<img src=\"$bestlink\">";
+ return "<img src=\"$bestlink\" alt=\"$linktext\" />";
}
return "<a href=\"$bestlink\">$linktext</a>";
} #}}}
indexlink => indexlink(),
wikiname => $config{wikiname},
pagebody => $pagebody,
+ styleurl => styleurl(),
);
return $template->output;
}#}}}