comparison MoinMoin/formatter/text_html.py @ 1628:79679aa664a3

formatter: fix empty pagename Page object generation
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 21 Oct 2006 01:50:39 +0200
parents 8a53c6676240
children 4b85e6506535
comparison
equal deleted inserted replaced
1627:82e8a6a2eb1b 1628:79679aa664a3
509 @keyword title: override using the interwiki wikiname as title 509 @keyword title: override using the interwiki wikiname as title
510 """ 510 """
511 wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, '%s:"%s"' % (interwiki, pagename)) 511 wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, '%s:"%s"' % (interwiki, pagename))
512 wikiurl = wikiutil.mapURL(self.request, wikiurl) 512 wikiurl = wikiutil.mapURL(self.request, wikiurl)
513 if wikitag == 'Self': # for own wiki, do simple links 513 if wikitag == 'Self': # for own wiki, do simple links
514 if on: 514 if '#' in wikitail:
515 if '#' in wikitail: 515 wikitail, kw['anchor'] = wikitail.split('#', 1)
516 wikitail, kw['anchor'] = wikitail.split('#', 1) 516 wikitail = wikiutil.url_unquote(wikitail)
517 wikitail = wikiutil.url_unquote(wikitail) 517 try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions!
518 try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions! 518 pagename = wikiutil.AbsPageName(self.request, self.page.page_name, wikitail)
519 return self.pagelink(on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail), **kw) 519 except:
520 except: 520 pagename = wikitail
521 return self.pagelink(on, wikitail, **kw) 521 return self.pagelink(on, pagename, **kw)
522 else:
523 return self.pagelink(0)
524 else: # return InterWiki hyperlink 522 else: # return InterWiki hyperlink
525 if on: 523 if on:
526 href = wikiutil.join_wiki(wikiurl, wikitail) 524 href = wikiutil.join_wiki(wikiurl, wikitail)
527 if wikitag_bad: 525 if wikitag_bad:
528 html_class = 'badinterwiki' 526 html_class = 'badinterwiki'