changeset 342:0979ace46676

Fix "edit page" title.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 16 Sep 2015 23:43:52 -0700
parents 37f426e067c4
children b0566f14f0f6
files wikked/webimpl/edit.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wikked/webimpl/edit.py	Wed Sep 16 23:04:28 2015 -0700
+++ b/wikked/webimpl/edit.py	Wed Sep 16 23:43:52 2015 -0700
@@ -43,10 +43,10 @@
 def make_page_title(url):
     endpoint, path = split_page_url(url)
     last_slash = path.rstrip('/').rfind('/')
-    if last_slash < 0:
-        title = url[1:]
+    if last_slash < 0 or last_slash == 0:
+        title = path.lstrip('/')
     else:
-        title = url[last_slash + 1:]
+        title = path[last_slash + 1:]
     if endpoint:
         return '%s: %s' % (endpoint, title)
     return title