From 4918c164e863a637445516c88fcd3efe6ae5262e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jul 2008 19:03:37 -0400 Subject: preserve case of subpage --- IkiWiki/Plugin/link.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'IkiWiki') 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 -- cgit v1.2.3