From: Joey Hess Date: Sat, 17 Nov 2007 21:32:02 +0000 (-0500) Subject: need to remove trailing slashes in not one, but 2 places X-Git-Url: https://scripts.mit.edu/gitweb/www/ikiwiki.git/commitdiff_plain/3e17b7d6122c2b1cbfa90dc04b419635342e2b02 need to remove trailing slashes in not one, but 2 places htmllink needs to do it because it uses the basename of the link as the link text bestlink needs to do it because it is not always called from htmllink --- diff --git a/IkiWiki.pm b/IkiWiki.pm index eb003a1fb..81a634e2b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -407,6 +407,7 @@ sub bestlink ($$) { #{{{ # absolute links $cwd=""; } + $link=~s/\/$//; do { my $l=$cwd; @@ -541,6 +542,7 @@ sub htmllink ($$$;@) { #{{{ my $page=shift; # the page that will contain the link (different for inline) my $link=shift; my %opts=@_; + $link=~s/\/$//; my $bestlink;