aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-06-29 16:38:32 -0400
committerJoey Hess <joey@kitenet.net>2011-06-29 16:38:32 -0400
commit25b01f94045eaa262587fcd18e8525eed9c18157 (patch)
treef63e437973ee35aebd9f511c8e18c80ace9d8d4f
parent9bae303ec42aaa7e6c1297505d296ebada185423 (diff)
downloadikiwiki-25b01f94045eaa262587fcd18e8525eed9c18157.tar
ikiwiki-25b01f94045eaa262587fcd18e8525eed9c18157.tar.gz
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.
-rw-r--r--IkiWiki.pm2
-rw-r--r--IkiWiki/Plugin/editpage.pm11
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn3
4 files changed, 16 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 7035cb034..8a66dcedb 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1237,7 +1237,7 @@ sub htmllink ($$$;@) {
$cgilink = "<a href=\"".
cgiurl(
do => "create",
- page => lc($link),
+ page => $link,
from => $lpage
)."\" rel=\"nofollow\">?</a>";
}
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm
index 3d094c263..a385ed839 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
@@ -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;
diff --git a/debian/changelog b/debian/changelog
index 7b8d84e45..ddd0f7a28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
index 059415819..351c2c1a1 100644
--- a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
+++ b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
@@ -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]]