comparison 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
comparison
equal deleted inserted replaced
1693:2014428d99ca 1694:fdf01f9f3143
614 except ValueError: 614 except ValueError:
615 try: 615 try:
616 wikiname, rest = wikiurl.split("/", 1) # for what is this used? 616 wikiname, rest = wikiurl.split("/", 1) # for what is this used?
617 except ValueError: 617 except ValueError:
618 wikiname, rest = 'Self', wikiurl 618 wikiname, rest = 'Self', wikiurl
619 first_char = rest[0] 619 if rest:
620 if first_char in QUOTE_CHARS: # quoted pagename 620 first_char = rest[0]
621 pagename_linktext = rest[1:].split(first_char, 1) 621 if first_char in QUOTE_CHARS: # quoted pagename
622 else: # not quoted, split on whitespace 622 pagename_linktext = rest[1:].split(first_char, 1)
623 pagename_linktext = rest.split(None, 1) 623 else: # not quoted, split on whitespace
624 pagename_linktext = rest.split(None, 1)
625 else:
626 pagename_linktext = "", ""
624 if len(pagename_linktext) == 1: 627 if len(pagename_linktext) == 1:
625 pagename, linktext = pagename_linktext[0], "" 628 pagename, linktext = pagename_linktext[0], ""
626 else: 629 else:
627 pagename, linktext = pagename_linktext 630 pagename, linktext = pagename_linktext
628 linktext = linktext.strip() 631 linktext = linktext.strip()