Preserve mixed case in page creation links, and when creating a page whose title...
authorJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 20:38:32 +0000 (16:38 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 20:38:32 +0000 (16:38 -0400)
IkiWiki.pm
IkiWiki/Plugin/editpage.pm
debian/changelog
doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn

index 7035cb034d96bdf3f2a92a8655e94e2b597bf39e..8a66dcedb4b0cb356aa02d1b9b9687fc1226916b 100644 (file)
@@ -1237,7 +1237,7 @@ sub htmllink ($$$;@) {
                                $cgilink = "<a href=\"".
                                        cgiurl(
                                                do => "create",
-                                               page => lc($link),
+                                               page => $link,
                                                from => $lpage
                                        )."\" rel=\"nofollow\">?</a>";
                        }
index 3d094c263196a7738295f81c8995ce365c5ce091..a385ed8395272446f62bbba41c5fb5876c0dbca0 100644 (file)
@@ -227,6 +227,8 @@ sub cgi_editpage ($$) {
                            $absolute ||
                            $form->submitted) {
                                @page_locs=$best_loc=$page;
+                               unshift @page_locs, lc($page)
+                                       if ! $form->submitted && lc($page) ne $page;
                        }
                        else {
                                my $dir=$from."/";
@@ -241,13 +243,18 @@ sub cgi_editpage ($$) {
                                        $best_loc=$dir.$page;
                                }
                                
+                               my $mixedcase=lc($page) ne $page;
+
+                               push @page_locs, $dir.lc($page) if $mixedcase;
                                push @page_locs, $dir.$page;
-                               push @page_locs, "$from/$page";
+                               push @page_locs, $from."/".lc($page) if $mixedcase;
+                               push @page_locs, $from."/".$page;
                                while (length $dir) {
                                        $dir=~s![^/]+/+$!!;
+                                       push @page_locs, $dir.lc($page) if $mixedcase;
                                        push @page_locs, $dir.$page;
                                }
-                       
+
                                my $userpage=IkiWiki::userpage($page);
                                push @page_locs, $userpage
                                        if ! grep { $_ eq $userpage } @page_locs;
index 7b8d84e45e4784b9d7185ca8d1ae6739397f0aa7..ddd0f7a28bf36ed5a301cd93c33bd6449f440ef2 100644 (file)
@@ -19,6 +19,9 @@ ikiwiki (3.20110609) UNRELEASED; urgency=low
     page by simply linking to them, or by using the img directive.
     Note that sanitizing svg files is still not addressed.
   * img: Generate png format thumbnails for svg images.
+  * Preserve mixed case in page creation links, and when creating a page
+    whose title is mixed case, allow selecting between the mixed case and
+    all lower-case names.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 09 Jun 2011 10:06:44 -0400
 
index 0594158194b23b9fcdd4be911c4ce2022b5dd704..351c2c1a141d640eb47b739c47f64407b1944c2d 100644 (file)
@@ -32,3 +32,6 @@ If I click on "Czars in Russia", I'd like Ikiwiki to create "Czars\_in\_Russia.m
 > Then, which one is the default wouldn't much matter. (The non-lower cased
 > one would probably be the best choice.) --[[Joey]]
 >> Either of your proposed solutions (make it the default or include both in the pop-up menu) sounds fine to me.  Which one is easier? :) --[[sabr]]
+
+>>> [[Done]]; it now defaults to the mixed case title and provides
+>>> the lower-case one as an option in the select box. --[[Joey]]