beautify_urlpath: add ./ before checking for /index.html
This fixes a bug: when a page links to its own #comments anchor you would get a link like "index.html#comments" rather than "./#comments".master
parent
95b3bbbf7c
commit
0844bd0b15
|
@ -949,16 +949,16 @@ sub formattime ($;$) {
|
|||
sub beautify_urlpath ($) {
|
||||
my $url=shift;
|
||||
|
||||
if ($config{usedirs}) {
|
||||
$url =~ s!/index.$config{htmlext}$!/!;
|
||||
}
|
||||
|
||||
# Ensure url is not an empty link, and if necessary,
|
||||
# add ./ to avoid colon confusion.
|
||||
if ($url !~ /^\// && $url !~ /^\.\.\//) {
|
||||
$url="./$url";
|
||||
}
|
||||
|
||||
if ($config{usedirs}) {
|
||||
$url =~ s!/index.$config{htmlext}$!/!;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue