aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-11-17 19:58:17 -0500
committerJoey Hess <joey@kodama.kitenet.net>2007-11-17 19:58:17 -0500
commitd00e8d78c806b4f94b2ab7bf70e2ffb9a56781cd (patch)
tree23a61e93adb01e936ff5b12f50dba9203e08d908 /IkiWiki.pm
parent9dd52850252fc3ad5961277db586cb29eb5d42bd (diff)
downloadikiwiki-d00e8d78c806b4f94b2ab7bf70e2ffb9a56781cd.tar
ikiwiki-d00e8d78c806b4f94b2ab7bf70e2ffb9a56781cd.tar.gz
* Don't consider links to anchors on the same page to be self links.
Patch by Daniel Burrows. Closes: #451729 * When usedirs is disabled, link direct to index.html files, not to directories, to improve browsing of file:// urls. Patch by Daniel Burrows. Closes: #451728
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 81a634e2b..c078a0055 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -514,7 +514,9 @@ sub displaytime ($;$) { #{{{
sub beautify_url ($) { #{{{
my $url=shift;
- $url =~ s!/index.$config{htmlext}$!/!;
+ if ($config{usedirs}) {
+ $url =~ s!/index.$config{htmlext}$!/!;
+ }
$url =~ s!^$!./!; # Browsers don't like empty links...
return $url;
@@ -562,7 +564,8 @@ sub htmllink ($$$;@) { #{{{
}
return "<span class=\"selflink\">$linktext</span>"
- if length $bestlink && $page eq $bestlink;
+ if length $bestlink && $page eq $bestlink &&
+ ! defined $opts{anchor};
if (! $destsources{$bestlink}) {
$bestlink=htmlpage($bestlink);