diff MoinMoin/wikiutil.py @ 1694:fdf01f9f3143

Use OtherWiki: as abbreviation for an interwiki link to a TwinPage, fix bug for interwiki links with empty pagename
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 02 Dec 2006 22:32:44 +0100
parents 0c301df3d4d0
children dc0db3897437
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Sat Dec 02 18:10:30 2006 +0100
+++ b/MoinMoin/wikiutil.py	Sat Dec 02 22:32:44 2006 +0100
@@ -616,11 +616,14 @@
             wikiname, rest = wikiurl.split("/", 1) # for what is this used?
         except ValueError:
             wikiname, rest = 'Self', wikiurl
-    first_char = rest[0]
-    if first_char in QUOTE_CHARS: # quoted pagename
-        pagename_linktext = rest[1:].split(first_char, 1)
-    else: # not quoted, split on whitespace
-        pagename_linktext = rest.split(None, 1)
+    if rest:
+        first_char = rest[0]
+        if first_char in QUOTE_CHARS: # quoted pagename
+            pagename_linktext = rest[1:].split(first_char, 1)
+        else: # not quoted, split on whitespace
+            pagename_linktext = rest.split(None, 1)
+    else:
+        pagename_linktext = "", ""
     if len(pagename_linktext) == 1:
         pagename, linktext = pagename_linktext[0], ""
     else: