aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-23 19:03:37 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-23 19:03:37 -0400
commit4918c164e863a637445516c88fcd3efe6ae5262e (patch)
tree78273a0d27391a010520df38d411c19dd554ddf3 /IkiWiki
parent8b063a24d909bfac056668f00513bf92f6f17817 (diff)
downloadikiwiki-4918c164e863a637445516c88fcd3efe6ae5262e.tar
ikiwiki-4918c164e863a637445516c88fcd3efe6ae5262e.tar.gz
preserve case of subpage
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/link.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
index e20109888..515a62bce 100644
--- a/IkiWiki/Plugin/link.pm
+++ b/IkiWiki/Plugin/link.pm
@@ -92,9 +92,10 @@ sub renamepage (@) { #{{{
my $link=$linktext;
if (bestlink($page, $2) eq $old) {
$link=$new;
- if ($linktext =~ m/\/*?[A-Z]/) {
- # preserve leading cap
- $link=ucfirst($link);
+ if ($linktext =~ m/.*\/*?[A-Z]/) {
+ # preserve leading cap of last component
+ my @bits=split("/", $link);
+ $link=join("/", @bits[0..$#bits-1], ucfirst($bits[$#bits]));
}
if (index($linktext, "/") == 0) {
# absolute link